atcoder#AGC021B. [AGC021B] Holes
[AGC021B] Holes
Score : points
Problem Statement
There are holes in a two-dimensional plane. The coordinates of the -th hole are .
Let . Ringo performs the following operation:
- Randomly choose a point from the interior of a circle of radius 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 , find the probability that Snuke falls into the -th hole.
Here, the operation of randomly choosing a point from the interior of a circle of radius is defined as follows:
- Pick two real numbers and independently according to uniform distribution on .
- If , the point is chosen. Otherwise, repeat picking the real numbers until the condition is met.
Constraints
- All given points are pairwise distinct.
- All input values are integers.
Input
Input is given from Standard Input in the following format:
Output
Print real numbers. The -th real number must represent the probability that Snuke falls into the -th hole.
The output will be judged correct when, for all output values, the absolute or relative error is at most .
2
0 0
1 1
0.5
0.5
If Ringo put Snuke in the region , Snuke will fall into the first hole. The probability of this happening is very close to . Otherwise, Snuke will fall into the second hole, the probability of which happening is also very close to .
5
0 0
2 8
4 5
2 6
3 10
0.43160120892732328768
0.03480224363653196956
0.13880483535586193855
0.00000000000000000000
0.39479171208028279727