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 (Python):
import math

N = int(input())
xy = [list(map(int, input().split())) for _ in range(N)]

for i in range(N):
  x, y = xy[i]
  lmin = 0
  lmax = 180
  rmin = 180
  rmax = 360
  for j in range(N):
    if i == j: continue
    p, q = xy[j][0] - x, xy[j][1] - y
    lt = math.degrees(math.atan2(q, p)) % 360
    rt = (lt + 180) % 360
    if lt > rt:
      rt, lt = lt, rt
      lmax = min(lmax, lt)
      rmin = max(rmin, rt)
    else:
      lmin = max(lmin, lt)
      rmax = min(rmax, rt)
  ans = 0
  if lmin < lmax:
    ans += (lmax - lmin) / 360
  if rmin < rmax:
    ans += (rmax - rmin) / 360
  print(ans)

Solution (Python):

"""

https://atcoder.jp/contests/agc021/tasks/agc021_b
偏角ソートそしてimos法

"""

import math
N = int(input())

xy = []
for i in range(N):
    x,y = map(int,input().split())
    xy.append((x,y))

start = []
end = []
pi = math.pi
now = [0] * N

for i in range(N):
    for j in range(i):

        x,y = xy[i]
        X,Y = xy[j]

        
        if x == X:
            if y > Y:
                start.append( (0,i) )
                end.append( ( pi , i) )
                start.append( ( pi,j) )
                end.append( (2 * pi , j) )
            else:
                start.append( (0,j) )
                end.append( ( pi , j) )
                start.append( ( pi,i) )
                end.append( (2 * pi , i) )
        elif y == Y: 
            if x > X:
                start.append( ( pi/2   ,j) )
                end.append(   ( 3*pi/2 ,j) )
                start.append( ( 3*pi/2 ,i) )
                end.append(   ( pi/2 ,i) )
                now[i] += 1
            else:
                start.append( ( pi/2   ,i) )
                end.append(   ( 3*pi/2 ,i) )
                start.append( ( 3*pi/2 ,j) )
                end.append(   ( pi/2 ,j) )
                now[j] += 1
        else: 
            
            k = -1 / ((Y-y)/(X-x)) 
            mx = (x+X)/2
            my = (y+Y)/2
            
            

            if k > 0:
                
                deg = math.atan(k)
                if y > k*(x-mx)+my:
                    start.append( (deg   ,i) )
                    end.append  ( (deg+pi,i) )
                    start.append( (deg+pi  ,j))
                    end.append  ( (deg,j))
                    now[j] += 1
                else:
                    start.append( (deg   ,j) )
                    end.append  ( (deg+pi,j) )
                    start.append( (deg+pi  ,i))
                    end.append  ( (deg,i))
                    now[i] += 1
            else:
                
                deg = math.atan(k)
                if y < k*(x-mx)+my:
                    start.append( (deg+pi,i) )
                    end.append  ( (deg+2*pi,i) )
                    start.append( (deg+2*pi,j))
                    end.append  ( (deg+pi,j))
                    now[j] += 1
                else:
                    start.append( (deg+pi,j) )
                    end.append  ( (deg+2*pi,j))
                    start.append( (deg+2*pi,i))
                    end.append  ( (deg+pi,i))
                    now[i] += 1
            

ans = [0] * N
start.sort()
end.sort()
si = 0
ei = 0
start.append((float("inf"),0))
end.append((float("inf"),0))

fmax = [None] * N




for i in range(N):
    if now[i] == N-1:
        fmax[i] = 0

for i in range(len(start)+len(end)-2):
    
    if start[si][0] < end[ei][0]:
        d,ind = start[si]
        si += 1
        now[ind] += 1
        if now[ind] == N-1:
            fmax[ind] = d
    else:
        d,ind = end[ei]
        ei += 1
        if now[ind] == N-1:
            
            ans[ind] += (d-fmax[ind])/(2*pi)
        now[ind] -= 1

for i in range(N):
    if now[i] == N-1:
        ans[i] += 1 - fmax[i]/(2*pi)

for i in ans:
    print (i)

Solution (Python):
import math
from copy import deepcopy
import sys
input = sys.stdin.readline

class Vec:
    def __init__(self, x, y):
        self.x = x
        self.y = y

    def __str__(self):
        return '({}, {})'.format(self.x, self.y)

    def __add__(self, other):
        return Vec(self.x+other.x, self.y+other.y)

    def __sub__(self, other):
        return Vec(self.x-other.x, self.y-other.y)

    def __mul__(self, k):
        return Vec(self.x*k, self.y*k)

    def __truediv__(self, k):
        return Vec(self.x/k, self.y/k)

    def __neg__(self):
        return Vec(-self.x, -self.y)

    def __eq__(self, other):
        return self.x == other.x and self.y == other.y

    def __ne__(self, other):
        return not (self == other)

    def abs(self):
        return (self.x**2 + self.y**2)**.5

    def dot(self, other):
        return self.x*other.x + self.y*other.y

    def cross(self, other):
        return self.x*other.y - self.y*other.x

    def rot(self, ang):
        c = math.cos(ang)
        s = math.sin(ang)
        return Vec(c*self.x-s*self.y, s*self.x+c*self.y)

    def arg(self):
        return math.atan2(self.y, self.x)


def convex_hull(points, eps=1e-12):
    n = len(points)
    points.sort(key=lambda p: (p.x, p.y))
    k = 0  
    ch = [None] * (2*n)
    
    for i in range(n):
        while k > 1 and (ch[k-1]-ch[k-2]).cross(points[i]-ch[k-1]) < eps:
            k -= 1
        ch[k] = points[i]
        k += 1
    t = k
    
    for i in range(0, n-1)[::-1]:
        while k > t and (ch[k-1]-ch[k-2]).cross(points[i]-ch[k-1]) < eps:
            k -= 1
        ch[k] = points[i]
        k += 1
    return ch[:k-1]


N = int(input())
points = [Vec(*map(int, input().split())) for _ in range(N)]
tmp = deepcopy(points)
ch = convex_hull(tmp)
ch.sort(key=lambda v: v.arg())
ans = [0] * N
for i in range(len(ch)):
    p0 = ch[(i-1) % len(ch)]
    p1 = ch[i]
    p2 = ch[(i+1) % len(ch)]
    a = (p2 - p1).arg() - (p1 - p0).arg()
    if a < 0:
        a += 2 * math.pi
    for j in range(N):
        if p1 == points[j]:
            ans[j] = a / (2 * math.pi)
print(*ans, sep='\n')

Solution (Python):
from math import acos
pi = 3.14159265358979323846264338
N = int(input())
A = [[0, 0, 0, _] for _ in range(N)]
flg = [False for _ in range(N)]
for i in range(N):
    A[i][1], A[i][2] = map(int, input().split())
    A[i][0] = A[i][1] * A[i][1] + A[i][2] * A[i][2]
X = [[A[i][1], A[i][2]] for i in range(N)]
A.sort(reverse=True)
stx, sty = A[0][1], A[0][2]
px, py = stx, sty
flg[A[0][3]] = True
prev_point = A[0][3]
convex_hull = [A[0][3]]
while True:
    min_prod2 = [[1, 1], [N+1, N+1], 1]
    for i in range(N):
        for j in range(N):
            if i != prev_point and j != prev_point:
                ffflg = True
                dx1 = X[i][0] - px
                dx2 = X[j][0] - px
                dy1 = X[i][1] - py
                dy2 = X[j][1] - py
                inner_prod = dx1 * dx2 + dy1 * dy2
                norm1 = dx1 * dx1 + dy1 * dy1
                norm2 = dx2 * dx2 + dy2 * dy2
                sign = (inner_prod > 0) - (inner_prod < 0)
                if sign < min_prod2[2]:
                    min_prod2[0] = [inner_prod*inner_prod, norm1*norm2]
                    min_prod2[1] = [i, j]
                    min_prod2[2] = sign
                elif sign == min_prod2[2]:
                    if sign == 1:
                        if min_prod2[0][0] * norm1 * norm2 > inner_prod * inner_prod * min_prod2[0][1]:
                            min_prod2[0] = [inner_prod*inner_prod, norm1*norm2]
                            min_prod2[1] = [i, j]
                        elif min_prod2[0][0] * norm1 * norm2 == inner_prod * inner_prod * min_prod2[0][1]:
                            if min_prod2[0][1] > norm1 * norm2 or min_prod2[1] == [N+1, N+1]:
                                min_prod2[0] = [inner_prod*inner_prod, norm1*norm2]
                                min_prod2[1] = [i, j]
                    elif sign == 0:
                        if min_prod2[0][1] > norm1 * norm2 or min_prod2[1] == [N+1, N+1]:
                            min_prod2[0] = [inner_prod*inner_prod, norm1*norm2]
                            min_prod2[1] = [i, j]
                    else:
                        if min_prod2[0][0] * norm1 * norm2 < inner_prod * inner_prod * min_prod2[0][1]:
                            min_prod2[0] = [inner_prod*inner_prod, norm1*norm2]
                            min_prod2[1] = [i, j]
                        elif min_prod2[0][0] * norm1 * norm2 == inner_prod * inner_prod * min_prod2[0][1]:
                            if min_prod2[0][1] > norm1 * norm2 or min_prod2[1] == [N+1, N+1]:
                                min_prod2[0] = [inner_prod*inner_prod, norm1*norm2]
                                min_prod2[1] = [i, j]
    if flg[min_prod2[1][0]] and flg[min_prod2[1][1]]:
        break
    else:
        if flg[min_prod2[1][0]] and not flg[min_prod2[1][1]]:
            prev_point = min_prod2[1][1]
        elif not flg[min_prod2[1][0]] and flg[min_prod2[1][1]]:
            prev_point = min_prod2[1][0]
        elif not flg[min_prod2[1][0]] and not flg[min_prod2[1][1]]:
            prev_point = min_prod2[1][0]
        convex_hull.append(prev_point)
        flg[prev_point] = True
        px, py = X[prev_point][0], X[prev_point][1]
M = len(convex_hull)
prob = [0 for _ in range(N)]
for i in range(M):
    center = convex_hull[i]
    ii, jj = convex_hull[(i-1)%M], convex_hull[(i+1)%M]
    dx1 = X[ii][0] - X[center][0]
    dx2 = X[jj][0] - X[center][0]
    dy1 = X[ii][1] - X[center][1]
    dy2 = X[jj][1] - X[center][1]
    ip = dx1 * dx2 + dy1 * dy2
    n1 = dx1 * dx1 + dy1 * dy1
    n2 = dx2 * dx2 + dy2 * dy2
    n1 = n1**0.5
    n2 = n2**0.5
    prob[center] = 0.5 - (acos((ip/n1)/n2))/(2*pi)
for i in range(N):
    print(prob[i])

Solution (Python):
import sys
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int,sys.stdin.readline().rstrip().split())

N = I()
A = []
for i in range(N):
    x,y = MI()
    A.append((x,y,i))

if N == 2:
    print(0.5)
    print(0.5)
    exit()




def area(X,Y,Z):  
    return (Y[0]-X[0])*(Z[1]-X[1])-(Y[1]-X[1])*(Z[0]-X[0])

from operator import itemgetter

def ConvexHull(A):  
    A = sorted(A,key=itemgetter(0,1))  
    res = []
    N = len(A)
    for i in range(N):  
        a = A[i]
        while len(res) > 1 and area(res[-2],res[-1],a) <= 0:  
            res.pop()
        res.append(a)
    r = len(res)
    for i in range(N-2,-1,-1):  
        a = A[i]
        while len(res) > r and area(res[-2],res[-1],a) <= 0:  
            res.pop()
        res.append(a)
    return res


B = ConvexHull(A)
del B[-1]
ANS = [0]*N

from math import acos,pi

for j in range(len(B)):
    x,y,i = B[j]
    if j == 0:
        x1,y1,i1 = B[-1]
        x2,y2,i2 = B[j+1]
    elif j == len(B)-1:
        x1,y1,i1 = B[j-1]
        x2,y2,i2 = B[0]
    else:
        x1,y1,i1 = B[j-1]
        x2,y2,i2 = B[j+1]
    ANS[i] = (pi - acos(((x1-x)*(x2-x)+(y1-y)*(y2-y))/((((x1-x)**2+(y1-y)**2)*((x2-x)**2+(y2-y)**2))**.5)))/(2*pi)

print(*ANS,sep='\n')

Solution (Python):
"""
@ 凸包をつくる
    > 凸包内部の点に属する領域は、半径Rの円からするともはやないものとして考えて良い
    > というかこの多角形自体点として考えていい！
@ 凸包の頂点vについて
    > vの両隣との傾きだけあればよい
    > その間の角度 / 360が答え
"""

from math import gcd, atan, pi, degrees

def cross3(a, b, c):
    return (b[0]-a[0])*(c[1]-a[1]) - (b[1]-a[1])*(c[0]-a[0])

def convex_hull(ps):
    qs = []
    N = len(ps)
    for p in ps:
        
        while len(qs) > 1 and cross3(qs[-1], qs[-2], p) > 0:
            qs.pop()
        qs.append(p)
    t = len(qs)
    for i in range(N-2, -1, -1):
        p = ps[i]
        while len(qs) > t and cross3(qs[-1], qs[-2], p) > 0:
            qs.pop()
        qs.append(p)
    return qs

def tup_to_key(tup):
    x, y = tup
    x += 10 ** 7
    y += 10 ** 7
    x *= 10 ** 8
    return x + y

def key_to_tup(key):
    x, y = divmod(key, 10 ** 8)
    x -= 10 ** 7
    y -= 10 ** 7
    return x, y

def angle(x1, y1, x2, y2):
    if y1 == y2:
        return pi / 2
    return atan(-(x1 - x2) / (y1 - y2))

def on_line(ps):
    st = set()
    for p, q in zip(ps, ps[1:]):
        px, py = p
        qx, qy = q
        dx, dy = qx - px, qy - py
        g = gcd(dx, dy)
        dx //= g
        dy //= g
        st.add(tup_to_key((dx, dy)))
    return len(st) == 1

if __name__ == "__main__":
    N = int(input())
    if N == 2:
        print(0.5)
        print(0.5)
        exit(0)

    res = dict()
    points = [list(map(int,input().split())) for _ in range(N)]

    
    
    
    
    
    

    if on_line(sorted(points)):
        mn = min(points)
        mx = max(points)
        res[tup_to_key(mn)] = 0.5
        res[tup_to_key(mx)] = 0.5
    else:
        ps = convex_hull(sorted(points))[:-1]
        sz = len(ps)
        for i, (x, y) in enumerate(ps):
            key = tup_to_key((x, y))
            lx, ly = ps[i - 1]
            rx, ry = ps[(i + 1) % sz]
            la = angle(x, y, lx, ly)
            ra = angle(x, y, rx, ry)
            a = ra - la
            
            
            
            if a < 0:
                a += pi
            
            res[key] = a / (2 * pi)

    for tup in points:
        key = tup_to_key(tup)
        if key in res:
            print(res[key])
        else:
            print(0)

Solution (Python):
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


n = int(input())
xy = [None]*n
for i in range(n):
    xy[i] = tuple(map(int, input().split()))
import cmath
ans = [0]*n
ps = [[] for _ in range(n)]
for i in range(n):
    for j in range(n):
        if i==j:
            continue
        v = (xy[i][0]-xy[j][0]) + (xy[i][1]-xy[j][1])*1j
        ps[i].append(cmath.polar(v)[1])
pi = cmath.pi
def sub(p):
    """p: 偏角のリスト
    """
    l = [[-pi, pi]]
    for pp in p:
        lb = pp-pi/2
        ub = pp+pi/2
        if lb<-pi:
            ll = [[lb+2*pi, pi], [-pi, ub]]
        elif ub>pi:
            ll = [[lb, pi], [-pi, ub-2*pi]]
        else:
            ll = [[lb,ub]]
        nl = []
        for i,item1 in enumerate(l):
            for j,item2 in enumerate(ll):
                item = [max(item1[0], item2[0]), min(item1[1], item2[1])]
                if item[0]<item[1]:
                    nl.append(item)
        l = nl
    return l
for i,p in enumerate(ps):
    lus = sub(p)
    for lu in lus:
        if lu[0]>lu[1]:
            ans[i] += 0
        else:
            ans[i] += (lu[1]-lu[0]) / (2*pi)
write("\n".join(map(str, ans)))

Solution (Python):
import copy
import numpy as np

def det(p, q):
    return p[0]*q[1] - p[1]*q[0]
def sub(p, q):
    return (p[0]-q[0], p[1]-q[1])
def get_convex_hull(points):
    n = len(points)
    points.sort()
    size_convex_hull = 0
    ch = []
    for i in range(n):
        while size_convex_hull > 1:
            v_cur = sub(ch[-1], ch[-2])
            v_new = sub(points[i], ch[-2])
            if det(v_cur, v_new) > 0:
                break
            size_convex_hull -= 1
            ch.pop()
        ch.append(points[i])
        size_convex_hull += 1

    t = size_convex_hull
    for i in range(n-2, -1, -1):
        while size_convex_hull > t:
            v_cur = sub(ch[-1], ch[-2])
            v_new = sub(points[i], ch[-2])
            if det(v_cur, v_new) > 0:
                break
            size_convex_hull -= 1
            ch.pop()
        ch.append(points[i])
        size_convex_hull += 1

    return ch[:-1]

N,*xyf = map(int, open(0).read().split())
xy = [(xyf[i*2],xyf[i*2+1]) for i in range(N)]
xyc = copy.deepcopy(xy)
ans = [0] * (N)
ch = get_convex_hull(xyc)
chs = set(ch)
l = len(ch)
for i in range(N):
    if xy[i] in chs:
        ind = ch.index(xy[i])
        a = (ch[ind-1],ch[ind])
        b = (ch[ind],ch[(ind+1)%l])
        u = np.array([a[0][0]-a[1][0],a[1][1]-a[0][1]])
        v = np.array([b[0][0]-b[1][0],b[1][1]-b[0][1]])
        inn = np.inner(u,v)
        nor = np.linalg.norm(u) * np.linalg.norm(v)
        cos = inn / nor
        ans[i] = (np.arccos(np.clip(cos, -1.0, 1.0))/(2*np.pi))
for x in ans:
    print(x)

Solution (Python):
def examA():
    N = I()
    ans = 0
    print(ans)
    return


def examB():
    def norm2(vec):
        return math.sqrt(vec[0] ** 2 + vec[1] ** 2)
    
    def ConvexHull(point_list):
        pos2idx = {point_list[i]: i for i in range(len(point_list))}
        y_val = defaultdict(list)
        x_list = sorted(list(set([p[0] for p in point_list])))
        for x, y in point_list:
            y_val[x].append(y)

        upper = [(x_list[0], max(y_val[x_list[0]]))]
        lower = [(x_list[0], min(y_val[x_list[0]]))]
        prev = float('inf')
        for xi in x_list[1:]:
            x0, y0 = upper[-1]
            x1, y1 = xi, max(y_val[xi])
            if (y1 - y0) / (x1 - x0) < prev:
                upper.append((x1, y1))
                prev = (y1 - y0) / (x1 - x0)
            else:
                while True:
                    x0, y0 = upper[-1]
                    if len(upper) == 1:
                        upper.append((x1, y1))
                        break
                    x00, y00 = upper[-2]
                    if (y1 - y0) / (x1 - x0) > (y1 - y00) / (x1 - x00):
                        upper.pop()
                    else:
                        prev = (y1 - y0) / (x1 - x0)
                        upper.append((x1, y1))
                        break

        prev = -float('inf')
        for xi in x_list[1:]:
            x0, y0 = lower[-1]
            x1, y1 = xi, min(y_val[xi])
            if (y1 - y0) / (x1 - x0) > prev:
                lower.append((x1, y1))
                prev = (y1 - y0) / (x1 - x0)
            else:
                while True:
                    x0, y0 = lower[-1]
                    if len(lower) == 1:
                        lower.append((x1, y1))
                        break
                    x00, y00 = lower[-2]
                    if (y1 - y0) / (x1 - x0) < (y1 - y00) / (x1 - x00):
                        lower.pop()
                    else:
                        prev = (y1 - y0) / (x1 - x0)
                        lower.append((x1, y1))
                        break

        
        

        upper_idx, lower_idx = [pos2idx[xy] for xy in upper], [pos2idx[xy] for xy in lower]
        if upper_idx[-1] == lower_idx[-1]:
            upper_idx.pop()
        CH_idx = upper_idx
        CH_idx.extend(reversed(lower_idx))
        if CH_idx[0] == CH_idx[-1] and len(CH_idx) > 1:
            CH_idx.pop()
        return CH_idx

    N = I()
    P = [[]for _ in range(N)]
    D = defaultdict(int)
    for i in range(N):
        x,y = LI()
        P[i] = (x,y)
        D[(x,y)] = i
    C = ConvexHull(P)
    ans = [0]*N
    if len(C)==2:
        for c in C:
            ans[c] = 0.5
        for v in ans:
            print(v)
        return
    
    for i,c in enumerate(C):
        s, t, u = C[i - 1], C[i], C[(i + 1) % len(C)]
        x0, y0 = P[s]
        x1, y1 = P[t]
        x2, y2 = P[u]
        vec0 = (y0 - y1, x1 - x0)
        vec1 = (y1 - y2, x2 - x1)
        ans[t] =  math.acos((vec0[0] * vec1[0] + vec0[1] * vec1[1]) / (norm2(vec0) * norm2(vec1))) / (2 * math.pi)
    for v in ans:
        print(v)
    return

def examC():
    ans = 0
    print(ans)
    return

def examD():
    S = SI()
    N = len(S)
    K = I()
    dp = [[[0 for _ in range(K+1)]for _ in range(N)]for _ in range(N)]
    for i in range(N):
        for j in range(K+1):
            dp[i][i][j] = 1
    for i in range(2,N+1):
        for k in range(K+1):
            for l,r in enumerate(range(i-1,N)):
                if S[l]==S[r]:
                    dp[l][r][k] = dp[l+1][r-1][k] + 2
                else:
                    if k>0:
                        dp[l][r][k] = max(dp[l+1][r][k],dp[l][r-1][k],dp[l+1][r-1][k-1]+2)
                    else:
                        dp[l][r][k] = max(dp[l + 1][r][k], dp[l][r - 1][k])
    ans = max(dp[0][-1])
    print(ans)
    return

def examE():
    ans = 0
    print(ans)
    return

def examF():
    ans = 0
    print(ans)
    return

def test():
    i = I()
    li = LI()
    lsi = LSI()
    si = LS()
    print(i)
    print(li)
    print(lsi)
    print(si)
    return

from decimal import Decimal as dec
import sys,bisect,itertools,heapq,math,random
from copy import deepcopy
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
def I(): return int(input())
def LI(): return list(map(int,sys.stdin.readline().split()))
def DI(): return dec(input())
def LDI(): return list(map(dec,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,mod2,inf,alphabet,_ep
mod = 10**9 + 7
mod2 = 998244353
inf = 10**18
_ep = 10**(-12)
alphabet = [chr(ord('a') + i) for i in range(26)]

sys.setrecursionlimit(10**7)

if __name__ == '__main__':
    examB()

"""
142
12 9 1445 0 1
asd dfg hj o o
aidn
"""

Solution (Python):
import math


class ConvexHull:
    """凸包に関する各種性質を求める"""
    def __init__(self, ps):
        self.n = len(ps)
        self.ps = sorted(ps)
        self.qs = []

        
        for p in self.ps:
            while len(self.qs) > 1 and self._ccw(self.qs[-2], self.qs[-1], p) < 0:
               self.qs.pop()
            self.qs.append(p)
        t = len(self.qs)

        
        for i in range(self.n - 2, -1, -1):
            p = self.ps[i]
            while len(self.qs) > 1 and self._ccw(self.qs[-2], self.qs[-1], p) < 0:
               self.qs.pop()
            self.qs.append(p)

    def _ccw(self, p1, p2, p3):
        """p1 -> p2 -> p3と頂点を移動したときの回転方向を返す。
        反時計回り -> +1、時計回り -> -1、0°もしくは180°回る -> 0
        """
        p2 = [p2[i] - p1[i] for i in range(2)]
        p3 = [p3[i] - p1[i] for i in range(2)]
        if p2[0] * p3[1] == p2[1] * p3[0]:
            return 0
        if p2[0] * p3[1] - p2[1] * p3[0] > 0:
            return +1
        else:
            return -1

    def get_ps(self):
        """凸包の頂点組を反時計回り順で求める（GrahamScan）。"""
        return self.qs


def get_theta(o, a, b):
    a = [a[i] - o[i] for i in range(2)]
    b = [b[i] - o[i] for i in range(2)]
    len_a = (a[0] ** 2 + a[1] ** 2) ** 0.5
    len_b = (b[0] ** 2 + b[1] ** 2) ** 0.5
    ab = a[0] * b[0] + a[1] * b[1]
    return 180 - math.degrees(math.acos(ab / len_a / len_b))


n = int(input())
info = [list(map(int, input().split())) for i in range(n)]

to_ind = {}
for i in range(n):
    to_ind[tuple(info[i])] = i

gs = ConvexHull(info)
ps = gs.get_ps()[:-1]
m = len(ps)

ans = [0.0] * n 
for i in range(m):
    ind = to_ind[tuple(ps[i])]
    ans[ind] = get_theta(ps[i], ps[(i - 1) % m], ps[(i + 1) % m]) / 360

for res in ans:
    print(res)

Solution (Python):
import math
import fractions



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)

    
    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]  
factinv = [1, 1]  
inv = [0, 1]  

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)

'''















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])


down = [0]

while(True):
    now = down[-1]
    nowxy = xy[down[-1]]
    
    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):
        continue
    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):
            gradmin = grad
            nxt = j
            
    down.append(nxt)

down = [xy[i][2] for i in down]
down = down[0:len(down)-1]


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


up = [0]
    
while(True):
    now = up[-1]
    nowxy = xy[up[-1]]
    
    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):
        continue
    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):
            
            gradmin = grad
            nxt = j
            
    up.append(nxt)
    

up = [xy[i][2] for i in up]
up = up[:len(up)-1]

seq = list(down)
for i in up:
    seq.append(i)



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)
    
    deg = math.pi - math.acos(cos)
    ans[num2] = deg/(2.0*math.pi)

for i in ans:
    print(i)

Solution (Python):
import math
from collections import defaultdict
n = int(input())
ipt = [list(map(int,input().split())) for i in range(n)]
xy = sorted(ipt)
convh1 = [xy[0],xy[1]]
def slope(xy1,xy2,const = 1):
  x1,y1 = xy1
  x2,y2 = xy2
  dx,dy = x2-x1,y2-y1
  if dx == 0:
    return 10**18*(y2-y1)*const//abs(y2-y1)
  else:
    return dy/dx
def convex(xy1,xy2,xy3,const = 1):
  x1,y1 = xy1
  x2,y2 = xy2
  x3,y3 = xy3
  if slope([x1,y1],[x2,y2],const) < slope([x2,y2],[x3,y3],const):
    return True
  return False
for i in range(2,n):
  x,y = xy[i]
  while len(convh1) >= 2 and not convex(convh1[-2],convh1[-1],[x,y]):
    convh1.pop()
  convh1.append(xy[i])
convh2 = [xy[-1],xy[-2]]
for i in range(n-2)[::-1]:
  x,y = xy[i]
  while len(convh2) >= 2 and not convex(convh2[-2],convh2[-1],[x,y],-1):
    convh2.pop()
  convh2.append(xy[i])
convh = convh1+convh2[1:-1]
prob = [0 for i in convh]
dc = defaultdict(int)
for i,xy in enumerate(convh):
  x,y = xy
  px,py = convh[i-1]
  nx,ny = convh[(i+1)%len(convh)]
  px -= x
  py -= y
  nx -= x
  ny -= y
  rad = math.atan2(ny,nx)-math.atan2(py,px)
  dc[(x,y)] = (math.pi-min(abs(rad),2*math.pi-abs(rad)))/(2*math.pi)
for x,y in ipt:
  print(dc[(x,y)])

Solution (Python):
def main():
    n = int(input())
    ab = [list(map(int, input().split())) for _ in [0]*n]

    def det(x, y, z):
        a = [x[0]-y[0], x[1]-y[1]]
        b = [z[0]-x[0], z[1]-x[1]]
        return a[0]*b[1]-a[1]*b[0]

    def convex_hull(ab):
        q, k = [], 0
        xy = sorted(ab)  
        for i in range(n):
            while k > 1 and det(q[k-1], q[k-2], xy[i]) <= 0:
                k -= 1
                q.pop()
            q.append(xy[i])
            k += 1
        t = k
        for i in range(n-2, -1, -1):
            while k > t and det(q[k-1], q[k-2], xy[i]) <= 0:
                k -= 1
                q.pop()
            q.append(xy[i])
            k += 1
        return q[:k-1]

    ans = convex_hull(ab)
    l = len(ans)
    d = dict()
    from math import acos
    from math import pi
    if l == 2:
        for a, b in ans:
            d[(a, b)] = 0.5
    else:
        b = 0
        ans += ans
        for i in range(l):
            a1 = ans[i][0]-ans[i-1][0]
            b1 = ans[i][1]-ans[i-1][1]
            a2 = ans[i+1][0]-ans[i][0]
            b2 = ans[i+1][1]-ans[i][1]
            a = acos((a1*a2+b1*b2)/((a1**2+b1**2)*(a2**2+b2**2))**0.5)
            d[tuple(ans[i])] = a/2/pi
    for a, b in ab:
        if (a, b) in d:
            print(d[(a, b)])
        else:
            print(0)


main()