#Q67. 「一本通 3.1 例 2」北极通讯网络

「一本通 3.1 例 2」北极通讯网络

Description

Original source: Waterloo University 2002

In a certain region of the Arctic, there are nn villages, each represented by a pair of integer coordinates (x,yx, y). To enhance communication, it is decided to establish a communication network among the villages. The communication tools can be either radio transceivers or satellite devices. All villages can be equipped with a radio transceiver, and all transceivers are of the same model. However, the number of satellite devices is limited, so only a subset of villages can be equipped with them.

Different models of radio transceivers have a parameter dd. Two villages can communicate directly via radio if the distance between them does not exceed dd. The larger the dd value, the more expensive the transceiver model. Villages equipped with satellite devices can communicate directly regardless of the distance between them.

Given kk satellite devices, write a program to determine how to allocate these kk devices so that the required dd value for the radio transceivers is minimized, ensuring that every pair of villages can communicate directly or indirectly.

For example, consider the following three villages:

Picture1

Here, AB=10,BC=20,AC=10522.36|AB|= 10, |BC|= 20, |AC|= 10\sqrt{5}≈22.36

If there are no satellite devices or only 11 satellite device (k=0k=0 or k=1k=1), the smallest dd that satisfies the condition is 2020. This is because AA and BB, and BB and CC can communicate directly via radio, while AA and CC can communicate indirectly through BB (i.e., messages are relayed from AA to BB and then from BB to CC).

If there are 22 satellite devices (k=2k=2), they can be allocated to BB and CC. The smallest dd can then be 1010, as AA and BB can communicate directly via radio, BB and CC can communicate directly via satellite, and AA and CC can communicate indirectly through BB.

If there are 33 satellite devices, AA, BB, and CC can all communicate directly via satellite, and the smallest dd can be 00.

Input Format

The first line contains two space-separated integers nn and kk;

The next nn lines each contain two integers, where the ii-th line's xi,yix_i, y_i represent the coordinates of the ii-th village (xi,yix_i, y_i).

Output Format

A real number representing the smallest dd value, rounded to 22 decimal places.

Sample 1

3 2
10 10
10 0
30 0

10.00

Data Range and Hints

For all data, 1n500,0x,y104,0k1001\le n\le 500, 0\le x, y\le 10^4, 0\le k\le 100.