QOJ.ac

QOJ

Límite de tiempo: 3 s Límite de memoria: 512 MB Puntuación total: 100

#6205. Observing the Stars

Estadísticas

EI is observing stars with a telescope. There are $n$ stars in the sky, each with a 2D Cartesian coordinate $(x, y)$. If his telescope is positioned at $(x_0, y_0)$, it can see all stars satisfying $(x - x_0)^2 + (y - y_0)^2 \le r^2$, where $r$ is the adjustable radius of the telescope. EI wants to know the minimum radius $r$ required to see at least $m$ stars.

Input

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

The next $n$ lines each contain two integers $x$ and $y$, representing the coordinates of a star. It is guaranteed that no two stars have the same coordinates.

Output

Output a single real number representing the minimum radius of the telescope. Let your answer be $a$ and the standard answer be $b$. Your answer is considered correct if $\frac{|a-b|}{\max(1,b)} \leq 10^{-6}$ (i.e., the absolute or relative error does not exceed $10^{-6}$).

Examples

Input 1

4 3
0 0
1 1
2 3
3 3

Output 1

1.41421356

Note 1

This is $\sqrt 2$.

Constraints

For $100\%$ of the data, it is guaranteed that $2\le m\le n\le 2000$ and $|x|, |y| \le 10^4$.

Subtask ID $n$ $m$ Score
$1$ $\le 50$ $\le n$ $10$
$2$ $\le 200$ $15$
$3$ $\le 700$ $15$
$4$ $\le 2000$ $= n$ $20$
$5$ $\le n$ $40$

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.