天天看點

Quoit Design

quoit design

time limit: 10000/5000 ms (java/others)    memory limit: 65536/32768 k (java/others)

total submission(s): 46340    accepted submission(s): 12084

這題可以分治:

首先按照x方向排序,然後分别對 兩邊求最短距離。

然後按照y排序,統計距離分割點-d 和+d之間的點,算了,忘了。

但是可以直接排序,然後枚舉相鄰三個點之間到距離。這三個點的組合總計三個距離,可以證明最短到距離一定存在于某個

三元組裡。

problem description

have you ever played quoit in a playground? quoit is a game in which flat rings are pitched at some toys, with all the toys encircled awarded.

in the field of cyberground, the position of each toy is fixed, and the ring is carefully designed so it can only encircle one toy at a time. on the other hand, to make the game look more attractive, the ring is designed to have the largest radius. given a configuration of the field, you are supposed to find the radius of such a ring.

assume that all the toys are points on a plane. a point is encircled by the ring if the distance between the point and the center of the ring is strictly less than the radius of the ring. if two toys are placed at the same point, the radius of the ring is considered to be 0.

input

the input consists of several test cases. for each case, the first line contains an integer n (2 <= n <= 100,000), the total number of toys in the field. then n lines follow, each contains a pair of (x, y) which are the coordinates of a toy. the input is terminated by n = 0.

output

for each test case, print in one line the radius of the ring required by the cyberground manager, accurate up to 2 decimal places. 

sample input

2 0 0 1 1 2 1 1 1 1 3 -1.5 0 0 0 0 1.5 0

sample output

0.71 0.00 0.75

author

chen, yue

source

zjcpc2004

recommend

jgshining

Quoit Design
Quoit Design

view code