#P4357. [CQOI2016] K 远点对
[CQOI2016] K 远点对
Description
Given the coordinates of points in the plane, find the -th farthest pair under the Euclidean distance.
The Euclidean distance between two points and is defined as .
Input Format
The first line contains two integers separated by a space.
The next lines each contain two integers , representing the coordinates of a point.
Output Format
Output a single integer on the first line, which is the square of the distance of the -th farthest pair (it is guaranteed to be an integer).
10 5
0 0
0 1
1 0
1 1
2 0
2 1
1 2
0 2
3 0
3 1
9
Hint
For of the testdata, $N \le 100000,1 \le K \le 100,K \le \dfrac {N(N-1)}{2},0 \le X,Y < 2^{31}$.
Translated by ChatGPT 5
京公网安备 11011102002149号