atcoder#AGC021B. [AGC021B] Holes

[AGC021B] Holes

Score : 600600 points

Problem Statement

There are NN holes in a two-dimensional plane. The coordinates of the ii-th hole are (xi,yi)(x_i,y_i).

Let R=10101010R=10^{10^{10^{10}}}. Ringo performs the following operation:

  • Randomly choose a point from the interior of a circle of radius RR centered at the origin, and put Snuke there. Snuke will move to the hole with the smallest Euclidean distance from the point, and fall into that hole. If there are multiple such holes, the hole with the smallest index will be chosen.

For every ii (1iN)(1 \leq i \leq N), find the probability that Snuke falls into the ii-th hole.

Here, the operation of randomly choosing a point from the interior of a circle of radius RR is defined as follows:

  • Pick two real numbers xx and yy independently according to uniform distribution on [R,R][-R,R].
  • If x2+y2R2x^2+y^2\leq R^2, the point (x,y)(x,y) is chosen. Otherwise, repeat picking the real numbers x,yx,y until the condition is met.

Constraints

  • 2N1002 \leq N \leq 100
  • xi,yi106(1iN)|x_i|,|y_i| \leq 10^6(1\leq i\leq N)
  • All given points are pairwise distinct.
  • All input values are integers.

Input

Input is given from Standard Input in the following format:

NN

x1x_1 y1y_1

::

xNx_N yNy_N

Output

Print NN real numbers. The ii-th real number must represent the probability that Snuke falls into the ii-th hole.

The output will be judged correct when, for all output values, the absolute or relative error is at most 10510^{-5}.

2
0 0
1 1
0.5
0.5

If Ringo put Snuke in the region x+y1x+y\leq 1, Snuke will fall into the first hole. The probability of this happening is very close to 0.50.5. Otherwise, Snuke will fall into the second hole, the probability of which happening is also very close to 0.50.5.

5
0 0
2 8
4 5
2 6
3 10
0.43160120892732328768
0.03480224363653196956
0.13880483535586193855
0.00000000000000000000
0.39479171208028279727