403548: GYM101192 J Covering distance

Memory Limit:64 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

J. Covering distancetime limit per test1 secondmemory limit per test64 megabytesinputstandard inputoutputstandard output

You are given a set of n geometric points. Assume arbitrary point P and all possible k non-degenerate different triangles Ti formed by point P and two other points within the set. Two triangles are considered different if they differ by at least one vertex. There are mi points ti, j situated strictly within Ti (points on the borders are excluded). Let's determine cover distance as , where dist(X, Y) means Euclidean distance between points X and Y. When there are no applicable points ti, j for point P, then cover distance is equal to -1.

You are required to compute cover distance for each point of the set.

Input

The first line contains number of points n. Following that are n lines, where the ith line contains coordinates of the ith point represented by two integer numbers xi yi. It is guaranteed that all points are distinct.

1 ≤ n ≤ 300
|xi|, |yi| ≤ 109
Output

For each point p output the required average distance. If no point satisfies the above requirements, output  - 1. Your output should have an absolute or relative error of at most 10 - 9.

ExampleInput
6
0 2
2 4
-1 3
0 0
1 3
1 2
Output
-1
1.885618083
1.648528137
2.290569415
1.414213562
1

加入题单

上一题 下一题 算法标签: