#P5549. [BJ United Round #3] 观察星象

    ID: 6302 远端评测题 1000~3000ms 125MiB 尝试: 0 已通过: 0 难度: 8 上传者: 标签>计算几何二分北京Special Judge随机化

[BJ United Round #3] 观察星象

Problem Description

EI is using a telescope to observe stars. There are nn stars in the sky, and each star has a 2D Cartesian coordinate (x,y)(x,y).

If the telescope is positioned at (x0,y0)(x_0,y_0), it can see all stars satisfying (x0x)2+(y0y)2r2(x_0-x)^2 + (y_0-y)^2 \le r^2.

The telescope size rr can be adjusted. EI wants to know: if he wants to see at least mm stars, what is the minimum value to set rr to?

Input Format

The first line contains two positive integers n,mn,m, representing the number of stars and the required number of stars to be seen.

The next nn lines each contain two integers x,yx,y, representing the coordinate of one star.

It is guaranteed that all star coordinates are pairwise distinct.

Output Format

Output one line containing one positive real number, representing the minimum radius of the telescope.

Let your answer be aa and the standard answer be bb. If abmax(1,b)106\frac{|a-b|}{\max(1,b)} \le 10^{-6} (i.e., the absolute error or relative error does not exceed 10610^{-6}), then your answer is accepted.

4 3
0 0
1 1
2 3
3 3
1.41421356

Hint

Subtask ID nn mm Score
11 50\leq 50 n\leq n 1010
22 200\leq 200 1515
33 700\leq 700
44 2000\leq 2000 =n= n 2020
55 n\leq n 4040

For 100%100\% of the testdata, it is guaranteed that:

2mn20002 \le m \le n \le 2000.

x,y104|x|,|y| \le 10^4.

By: EntropyIncreaser.

Translated by ChatGPT 5