#P1991. 无线通讯网

无线通讯网

Description

The Ministry of National Defense plans to connect several border outposts with a wireless network using two different communication technologies.

Every outpost must be equipped with a radio transceiver; some outposts can additionally be equipped with satellite phones.

Any two outposts that both have satellite phones can talk to each other, no matter how far apart they are. Outposts that communicate only through radio transceivers must be within a distance of DD, due to the power limit of the transceivers. The higher the power, the larger DD becomes, but the cost also increases.

The transceivers must be purchased and installed uniformly, so all outposts can only install one model of transceiver. In other words, the radio communication distance between any pair of outposts is the same DD. Your task is to determine the minimum radio range DD such that between every pair of outposts there is at least one communication path (direct or indirect).

Input Format

The first line contains 22 integers SS and PP. SS is the number of outposts that can be equipped with satellite phones, and PP is the total number of outposts.

Then there are PP lines. Each line contains two integers x,yx, y that give the planar coordinates (x,y)(x, y) of an outpost, in km.

Output Format

Output one real number DD on the first line, the minimum transmission distance required for the radio transceivers, accurate to two decimal places.

2 4
0 100
0 300
0 600
150 750

212.13

Hint

Constraints

  • For 20%20\% of the testdata: P=2P = 2, S=1S = 1.
  • For another 20%20\% of the testdata: P=4P = 4, S=2S = 2.
  • For 100%100\% of the testdata it is guaranteed that 1S1001 \le S \le 100, S<P500S < P \le 500, 0x,y100000 \le x, y \le 10000.

Translated by ChatGPT 5