In a k-dimensional space, there are n points, find the square of the distance from the nearest point pair.
13801380
In a k-dimensional space, there are n points, find the square of the distance from the nearest point pair.
The first line is the number of test T (1<=T<=5)
For each test:
In the first line, there will be two integers N(2<=N<=1e5), K(1<=K<=5).
N is the number of points. K is the size of the dimension.
In the next N lines, i-th line will have K integers {a1,a2,...,aj,...,ak-1,ak}, which means the coordinates of the i-th point.(-1e5<=aj<=1e5).
Output the square of the distance from the nearest point pair.
2
2 1
1
1
3 3
1 2 3
2 3 4
3 4 5
0
3