#20. Support or Not

Support or Not

Problem Description

There are nn spheres in the three-dimensional space, labeled by 1,2,...,n1, 2, ... , n. The center of the ii-th sphere is at point (xi,yi,zi)(x_i, y_i, z_i), and its radius is rir_i.

Let us denote the distance between spheres ii and jj as

$$d(i,j) = max{\left(0, \sqrt{(x_i-x_j)^2 + (y_i-y_j)^2 + (z_i-z_j)^2} - r_i - r_j\right)} $$

That means choosing two points PP and QQ, where PP is inside or on the surface of sphere ii and QQ is inside or on the surface of sphere jj, and minimizing the Euclidean distance between PP and QQ.

There are n(n1)2\frac{n(n−1)}{2} pairs (i,j)(i, j) such that 1i<jn1 \le i < j \le n. Please find the smallest kk values among the values of d(i,j)d(i, j) for all these pairs.

Input

The first line of the input contains an integer T(1T3)T (1 \le T \le 3), denoting the number of test cases.

Each test case starts with a single line containing two integers nn and kk $(2\le n\le 100000, 1\le k\le \min(300,\frac {n(n−1)} 2)$, denoting the number of spheres and the parameter kk.

Each of the next nn lines contains four integers, xix_i, yiy_i, ziz_i, and rir_i, (0xi,yi,zi106,1ri106)(0 \le x_i, y_i, z_i \le 10^6, 1 \le r_i \le 10^6), describing ii-th sphere.

Output

For each test case, print kk lines, each line containing a single integer: the smallest kk values among d(i,j)d(i, j), in non-decreasing order. To avoid precision error, print the values of d(i,j)\lceil d(i, j)\rceil: the values of the respective d(i,j)d(i, j) rounded up. For example, 5=5\lceil5\rceil = 5, and 5.1=6\lceil5.1\rceil = 6.

Sample

1
4 6
0 0 0 1
0 3 2 2
3 2 1 1
1 1 2 2
0
0
0
1
1
2