Problem:
Score : 600 points

Problem Statement

There are N holes in a two-dimensional plane. The coordinates of the i-th hole are (x_i,y_i).

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

Randomly choose a point from the interior of a circle of radius R 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 i (1 \leq i \leq N), find the probability that Snuke falls into the i-th hole.

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

Pick two real numbers x and y independently according to uniform distribution on [-R,R].

If x^2+y^2\leq R^2, the point (x,y) is chosen. Otherwise, repeat picking the real numbers x,y until the condition is met.

Constraints

2 \leq N \leq 100

|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:

N
x_1 y_1
:
x_N y_N

Output

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

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

Sample Input 1

2
0 0
1 1

Sample Output 1

0.5
0.5

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

Sample Input 2

5
0 0
2 8
4 5
2 6
3 10

Sample Output 2

0.43160120892732328768
0.03480224363653196956
0.13880483535586193855
0.00000000000000000000
0.39479171208028279727

Solution in PyPy3 (2.4.0) (judge verdict: Runtime Error)

import math
import fractions
#import sys
#input = sys.stdin.readline

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors

def ValueToBits(x,digit):
    res = [0 for i in range(digit)]
    now = x
    for i in range(digit):
        res[i]=now%2
        now = now >> 1
    return res

def BitsToValue(arr):
    n = len(arr)
    ans = 0
    for i in range(n):
        ans+= arr[i] * 2**i
    return ans

def ZipArray(a):
    aa = [[a[i],i]for i in range(n)]

    aa.sort(key = lambda x : x[0])
    for i in range(n):
        aa[i][0]=i+1
    aa.sort(key = lambda x : x[1])
    b=[aa[i][0] for i in range(len(a))]
    return b

def ValueToArray10(x, digit):
    ans = [0 for i in range(digit)]
    now = x
    for i in range(digit):
        ans[digit-i-1] = now%10
        now = now //10
    return ans

def Zeros(a,b):
    if(b<=-1):
        return [0 for i in range(a)]
    else:
        return [[0 for i in range(b)] for i in range(a)]

class Bit:
    def __init__(self, n):
        self.size = n
        self.tree = [0] * (n + 1)
 
    def sum(self, i):
        s = 0
        while i > 0:
            s += self.tree[i]
            i -= i & -i
        return s
 
    def add(self, i, x):
        while i <= self.size:
            self.tree[i] += x
            i += i & -i
            
'''
def cmb(n, r, p):
    if (r < 0) or (n < r):
        return 0
    r = min(r, n - r)
    return fact[n] * factinv[r] * factinv[n-r] % p

p = 10**9 + 7
N = 10 ** 6 + 2
fact = [1, 1]  # fact[n] = (n! mod p)
factinv = [1, 1]  # factinv[n] = ((n!)^(-1) mod p)
inv = [0, 1]  # factinv 計算用

for i in range(2, N + 1):
    fact.append((fact[-1] * i) % p)
    inv.append((-inv[p % i] * (p // i)) % p)
    factinv.append((factinv[-1] * inv[-1]) % p)

'''

#a = list(map(int, input().split()))

#################################################
#################################################
#################################################
#################################################



#11:00




n = int(input())
xy = []

for i in range(n):
    xy.append(list(map(int, input().split())))
    xy[-1].append(i)
    
origin = list(xy)
xy.sort(key = lambda x : -x[1])
xy.sort(key = lambda x : x[0])
#print(xy)

down = [0]

while(True):
    now = down[-1]
    nowxy = xy[down[-1]]
    #print(now,nowxy)
    if(now==n-1):
        break
    shouldBreak = 0
    for j in range(now+1,n):
        if(nowxy[0] == xy[j][0]):
            down.append(j)
            shouldBreak=1
            break
    if(shouldBreak):
        break
    gradmin = 10**18
    nxt = -1
    for j in range(now+1,n):
        grad = (xy[j][1]-nowxy[1])/(xy[j][0]-nowxy[0])
        #print(grad)
        if(gradmin > grad):
            gradmin = grad
            nxt = j
            
    down.append(nxt)
#print(down)
down = [xy[i][2] for i in down]
down = down[0:len(down)-1]
#print(down)

xy.sort(key = lambda x : x[1])
xy.sort(key = lambda x : -x[0])
#print(xy)

up = [0]
    
while(True):
    now = up[-1]
    nowxy = xy[up[-1]]
    #print(now,nowxy)
    if(now==n-1):
        break
    
    shouldBreak = 0
    for j in range(now+1,n):
        if(nowxy[0] == xy[j][0]):
            up.append(j)
            shouldBreak=1
            break
    if(shouldBreak):
        break
    gradmin = 10**18
    nxt = -1
    for j in range(now+1,n):
        grad = (xy[j][1]-nowxy[1])/(xy[j][0]-nowxy[0])
        if(gradmin > grad):
            #print("g",j,grad)
            gradmin = grad
            nxt = j
            
    up.append(nxt)
    #print(up)
#print(up)
up = [xy[i][2] for i in up]
up = up[:len(up)-1]
#print(up)
seq = list(down)
for i in up:
    seq.append(i)

#print(seq)

ans = [0.0 for i in range(n)]

def u2(a):
    return math.sqrt(a[0]*a[0]+a[1]*a[1])
def dot(a,b):
    return a[0]*b[0]+a[1]*b[1]

m = len(seq)
for i in range(len(seq)):
    num1,num2,num3 = seq[(i-1)%m],seq[i],seq[(i+1)%m]
    p1,p2,p3 = origin[num1],origin[num2], origin[num3]
    left = [p1[0]-p2[0],p1[1]-p2[1]]
    right = [p3[0]-p2[0],p3[1]-p2[1]]
    cos = dot(left,right)/u2(left)/u2(right)
    #print(cos,left,right)
    deg = math.pi - math.acos(cos)
    ans[num2] = deg/(2.0*math.pi)

for i in ans:
    print(i)