AtCoder Grand Contest 021 - Holes

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}.

Examples

Input

2
0 0
1 1


Output

0.5
0.5


Input

5
0 0
2 8
4 5
2 6
3 10


Output

0.43160120892732328768
0.03480224363653196956
0.13880483535586193855
0.00000000000000000000
0.39479171208028279727

Source: atcoder | Difficulty: UNKNOWN_DIFFICULTY


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


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


import math
import cmath

def arg(center, point):
	return cmath.phase(complex(point[0] - center[0], point[1] - center[1]))
n = int(input())
dots = [list(map(int, input().split())) for _ in range(n)]
if n == 2:
	print(0.5)
	print(0.5)
else:
	ans = []
	for d in dots:
		arg_list = []
		for e in dots:
			if d == e:
				continue
			else:
				arg_list.append(arg(d, e))
		arg_list.sort()
		convex = False
		if arg_list[-1] - arg_list[0] <= math.pi:
			convex = True
			theta = arg_list[-1] - arg_list[0]
			ans.append(0.5 - theta / (2 * math.pi))
		else:
			for i in range(len(arg_list) - 1):
				if arg_list[i + 1] - arg_list[i] >= math.pi:
					convex = True
					theta = arg_list[i + 1] - arg_list[i]
					ans.append(theta / (2 * math.pi) - 0.5)
			if convex == False:
				ans.append(0)
	for a in ans:
		print(a)


import math
from functools import reduce
n = int(input())
xy = []
for i in range(n):
	(x, y) = [int(item) for item in input().split()]
	xy.append([x, y, i])

def convex_hull_graham(points):
	(TURN_LEFT, TURN_RIGHT, TURN_NONE) = (1, -1, 0)

	def cmp(a, b):
		return (a > b) - (a < b)

	def turn(p, q, r):
		return cmp((q[0] - p[0]) * (r[1] - p[1]) - (r[0] - p[0]) * (q[1] - p[1]), 0)

	def _keep_left(hull, r):
		while len(hull) > 1 and turn(hull[-2], hull[-1], r) == TURN_RIGHT:
			hull.pop()
		if not len(hull) or hull[-1] != r:
			hull.append(r)
		return hull
	points = sorted(points)
	l = reduce(_keep_left, points, [])
	u = reduce(_keep_left, reversed(points), [])
	return l.extend((u[i] for i in range(1, len(u) - 1))) or l
ret = convex_hull_graham(xy)
ret.append(ret[0])
ret.append(ret[1])
thetas = [0.0] * n
for i in range(1, len(ret) - 1):
	v1 = [-ret[i][1] + ret[i - 1][1], ret[i][0] - ret[i - 1][0]]
	v2 = [-ret[i + 1][1] + ret[i][1], ret[i + 1][0] - ret[i][0]]
	v1_norm = math.sqrt(v1[0] ** 2.0 + v1[1] ** 2.0)
	v2_norm = math.sqrt(v2[0] ** 2.0 + v2[1] ** 2.0)
	thetas[ret[i][2]] = math.acos((v1[0] * v2[0] + v1[1] * v2[1]) / (v1_norm * v2_norm))
for item in thetas:
	print(item / (math.pi * 2.0))


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


from math import atan2, pi
N = int(input())
points = [[int(i) for i in input().split()] for i in range(N)]
p = [0] * N
for i in range(N):
	angle_p = []
	angle_n = []
	for j in range(N):
		if i != j:
			c = atan2(points[i][1] - points[j][1], points[i][0] - points[j][0])
			if c >= 0:
				angle_p.append(c)
			else:
				angle_n.append(c)
	if len(angle_n) == 0:
		d = max(angle_p) - min(angle_p)
	elif len(angle_p) == 0:
		d = max(angle_n) - min(angle_n)
	elif max(angle_p) - min(angle_n) < pi:
		d = max(angle_p) - min(angle_n)
	elif pi - min(angle_p) + max(angle_n) < 0:
		d = 2 * pi - min(angle_p) + max(angle_n)
	else:
		d = pi
	p[i] = (pi - d) / (2 * pi)
for i in range(N):
	print(p[i])


import math
N = int(input())
H = [list(map(int, input().split())) for i in range(N)]
P = [[0, 2 * math.pi] for i in range(N)]
for i in range(N):
	for j in range(N):
		if i == j:
			continue
		rad = math.atan2(H[i][1] - H[j][1], H[i][0] - H[j][0])
		mi = (rad - math.pi / 2) % (2 * math.pi)
		ma = (rad + math.pi / 2) % (2 * math.pi)
		if ma > mi:
			if P[i][0] >= P[i][1]:
				if mi < P[i][1]:
					P[i] = [mi, P[i][1]]
				elif ma > P[i][0]:
					P[i] = [P[i][0], ma]
				else:
					P[i] = [0, 0]
					break
			else:
				P[i] = [max(P[i][0], mi), min(P[i][1], ma)]
				if P[i][0] >= P[i][1]:
					P[i] = [0, 0]
					break
		elif P[i][0] >= P[i][1]:
			P[i] = [max(P[i][0], mi), min(P[i][1], ma)]
		elif P[i] == [0, 2 * math.pi]:
			P[i] = [mi, ma]
		elif mi < P[i][1]:
			if mi < P[i][0]:
				continue
			else:
				P[i] = [mi, P[i][1]]
		elif ma > P[i][0]:
			if ma > P[i][1]:
				continue
			else:
				P[i] = [P[i][0], ma]
		else:
			P[i] = [0, 0]
			break
for p in P:
	print((p[1] - p[0]) / (2 * math.pi) % 1)


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


import sys
input = sys.stdin.readline
from math import atan2, pi

def InnerProduct(V0, V1):
	(x0, y0) = V0
	(x1, y1) = V1
	return x0 * x1 + y0 * y1

def CrossProduct(V0, V1):
	(x0, y0) = V0
	(x1, y1) = V1
	return x0 * y1 - x1 * y0

def clockwise(P0, P1, P2):
	(V0, V1) = ((P1[0] - P0[0], P1[1] - P0[1]), (P2[0] - P0[0], P2[1] - P0[1]))
	return CrossProduct(V0, V1) < 0

def MonotoneChain(V):
	(upper, lower) = ([], [])
	P = sorted(V)
	for p in P:
		while len(lower) > 1 and (not clockwise(lower[-2], lower[-1], p)):
			lower.pop()
		lower.append(p)
	for p in P[::-1]:
		while len(upper) > 1 and (not clockwise(upper[-2], upper[-1], p)):
			upper.pop()
		upper.append(p)
	return lower[:-1] + upper[:-1]
n = int(input())
P = [tuple(map(int, input().split())) for _ in range(n)]
d = {p: i for (i, p) in enumerate(P)}
ans = [0] * n
CH = MonotoneChain(P)
CH += [CH[0], CH[1]]
for ((x0, y0), (x1, y1), (x2, y2)) in zip(CH, CH[1:], CH[2:]):
	(V0, V1) = ((x0 - x1, y0 - y1), (x2 - x1, y2 - y1))
	ans[d[x1, y1]] = (pi - atan2(CrossProduct(V0, V1), InnerProduct(V0, V1))) / (2 * pi)
for a in ans:
	print(a)


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) ** 0.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')


from math import pi, atan2

def andrange(a, b):
	if a == (0, 0) or b == (0, 0):
		return (0, 0)
	if a == (0, 1):
		return b
	if b == (0, 1):
		return a
	if a[0] > b[0]:
		(a, b) = (b, a)
	if b[1] < a[1]:
		return b
	if b[0] < a[1]:
		return (b[0], a[1])
	if b[1] < a[0] + 1:
		return (0, 0)
	if b[1] < a[1] + 1:
		return (a[0], b[1] - 1)
	return a

def calcrange(P, Q):
	c = atan2(P[1] - Q[1], P[0] - Q[0]) / (2 * pi)
	if c > 0:
		return (c, c + 0.5)
	else:
		return (c + 1, c + 1.5)
N = int(input())
X = []
for _ in range(N):
	(x, y) = map(int, input().split())
	X.append((x, y))
A = [(0, 1) for _ in range(N)]
for i in range(N):
	for j in range(N):
		if i != j:
			A[i] = andrange(A[i], calcrange(X[i], X[j]))
for a in A:
	print('{:.15f}'.format(a[1] - a[0]))


import math
n = int(input())
ps = [tuple(map(int, input().split())) for _ in range(n)]
mp = {tuple(p): i for (i, p) in enumerate(ps)}

def ccw(p0, p1, p2):
	return (p1[0] - p0[0]) * (p2[1] - p0[1]) - (p1[1] - p0[1]) * (p2[0] - p0[0]) >= 0

def convex_hull(ps):
	upper = []
	lower = []
	ps.sort()
	for p in ps:
		while len(lower) > 1 and ccw(lower[-2], lower[-1], p):
			lower.pop()
		lower.append(p)
	for p in ps[::-1]:
		while len(upper) > 1 and ccw(upper[-2], upper[-1], p):
			upper.pop()
		upper.append(p)
	return lower[:-1] + upper[:-1]
ans = [0] * n
ch = convex_hull(ps)
ch += [ch[0]]
ch += [ch[1]]
for (pre, now, next) in zip(ch, ch[1:], ch[2:]):
	x0 = now[0] - pre[0]
	y0 = now[1] - pre[1]
	x1 = next[0] - now[0]
	y1 = next[1] - now[1]
	ans[mp[tuple(now)]] = math.atan2(x1 * y0 - x0 * y1, x0 * x1 + y0 * y1) / (2 * math.pi)
for a in ans:
	print(a)


import math
q = 2 * math.pi
from cmath import phase as h
t = lambda x: h(x) + (q if 0 > h(x) else 0)
n = int(input())
r = range(n)
c = [complex(input().replace(' -', '-').replace(' ', '+') + 'j') for _ in r]
for i in r:
	a = sorted([t(c[j] - c[i]) / q for j in r if j != i])
	d = [a[j] - a[j - 1] for j in r[:-1]]
	d[0] += 1
	print(max(max(d) - 1 / 2, 0))


import math

def ccw(p0, p1, p2):
	return (p1[0] - p0[0]) * (p2[1] - p0[1]) - (p1[1] - p0[1]) * (p2[0] - p0[0])
N = int(input())
pts = [(tuple(map(int, input().split())), i) for i in range(N)]
pts.sort()
chU = []
for (pt, i) in pts:
	while len(chU) >= 2 and ccw(chU[-2][0], chU[-1][0], pt) >= 0:
		chU.pop()
	chU.append((pt, i))
chL = []
for (pt, i) in reversed(pts):
	while len(chL) >= 2 and ccw(chL[-2][0], chL[-1][0], pt) >= 0:
		chL.pop()
	chL.append((pt, i))
CH = chU[:-1] + chL[:-1]
aIn = math.atan2(CH[-1][0][1] - CH[0][0][1], CH[-1][0][0] - CH[0][0][0])
ptNow = CH[-1][0]
anss = [0.0] * N
for i in reversed(range(len(CH))):
	iNow = CH[i][1]
	pt2 = CH[i - 1][0]
	aOut = math.atan2(pt2[1] - ptNow[1], pt2[0] - ptNow[0])
	anss[iNow] = (aOut - aIn) % (2 * math.pi) / (2 * math.pi)
	ptNow = pt2
	aIn = aOut
for ans in anss:
	print(ans)


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def ccw(a, b, c):
	ax = b[0] - a[0]
	ay = b[1] - a[1]
	bx = c[0] - a[0]
	by = c[1] - a[1]
	t = ax * by - ay * bx
	if t > 0:
		return 1
	if t < 0:
		return -1
	if ax * bx + ay * by < 0:
		return 2
	if ax * ax + ay * ay < bx * bx + by * by:
		return -2
	return 0

def convex_hull(ps):
	n = len(ps)
	k = 0
	ps.sort()
	ch = [None] * (n * 2)
	for i in range(n):
		while k >= 2 and ccw(ch[k - 2], ch[k - 1], ps[i]) <= 0:
			k -= 1
		ch[k] = ps[i]
		k += 1
	t = k + 1
	for i in range(n - 2, -1, -1):
		while k >= t and ccw(ch[k - 2], ch[k - 1], ps[i]) <= 0:
			k -= 1
		ch[k] = ps[i]
		k += 1
	return ch[:k - 1]

def radian(a, b):
	return math.atan2(b[1] - a[1], b[0] - a[0])

def main():
	n = I()
	a = [LI() + [_] for _ in range(n)]
	t = convex_hull(a)
	l = len(t)
	r = [0] * n
	if l == 2:
		r[t[0][2]] = 0.5
		r[t[1][2]] = 0.5
	else:
		for i in range(l):
			r1 = radian(t[i], t[i - 1])
			r2 = radian(t[i], t[(i + 1) % l])
			k = r2 - r1
			while k < 0:
				k += math.pi * 2
			e = (k - math.pi) / math.pi / 2
			r[t[i][2]] = e
	return '\n'.join(map(str, r))
print(main())


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)) ** 0.5)) / (2 * pi)
print(*ANS, sep='\n')


from math import atan2, pi
(N, *XY) = map(int, open(0).read().split())
XY = list(zip(*[iter(XY)] * 2))
for (i, (x, y)) in enumerate(XY):
	D = sorted((atan2(X - x, Y - y) for (j, (X, Y)) in enumerate(XY) if j != i))
	D.append(D[0] + 2 * pi)
	ans = 0
	for (a, b) in zip(D, D[1:]):
		if b - a >= pi:
			ans = b - a - pi
			break
	print(ans / (2 * pi))


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

def vec(pi, pj):
	return (pj[0] - pi[0], pj[1] - pi[1])

def det(vi, vj):
	return vi[0] * vj[1] - vi[1] * vj[0]
cvx = []
for i in list(range(N)) + list(range(N - 1))[::-1]:
	while len(cvx) >= 2 and det(vec(ps[cvx[-2]], ps[cvx[-1]]), vec(ps[cvx[-1]], ps[i])) < 0:
		cvx.pop()
	cvx.append(i)
ans = {}
pi = None
for i in cvx:
	(x, y, j) = ps[i]
	if pi is not None:
		(px, py, pj) = ps[pi]
		slope = math.atan2(y - py, x - px)
		if j not in ans:
			ans[j] = [0, 0]
		if pj not in ans:
			ans[pj] = [0, 0]
		ans[j][0] = slope
		ans[pj][1] = slope
	pi = i
for i in range(N):
	if i not in ans:
		print(0)
		continue
	(v1, v2) = ans[i]
	if v2 < v1:
		v2 += 2 * math.pi
	print(round((v2 - v1) / (2 * math.pi), 8))


import math
pi = 3.1415926575897934

def cross(C, A, B):
	return (C[0] - A[0]) * (C[1] - B[1]) - (C[1] - A[1]) * (C[0] - B[0])

def convex_hull(P):
	P.sort()
	Q = []
	for p in P:
		while 1 < len(Q) and cross(Q[-2], Q[-1], p) >= 0:
			Q.pop()
		Q.append(p)
	k = len(Q)
	for p in reversed(P[:-1]):
		while k < len(Q) and cross(Q[-2], Q[-1], p) >= 0:
			Q.pop()
		Q.append(p)
	return Q
n = int(input())
arr = []
for _ in range(n):
	(x, y) = map(int, input().split())
	arr.append((x, y))
arr2 = convex_hull(arr[:])[:-1]
ans = [0] * n
if n == 2:
	print(0.5)
	print(0.5)
else:
	for i in range(n):
		pos = arr[i]
		if pos not in arr2:
			continue
		else:
			idx = arr2.index(pos)
			pos1 = arr2[idx - 1]
			pos2 = arr2[(idx + 1) % len(arr2)]
			x1 = pos[0] - pos1[0]
			y1 = pos[1] - pos1[1]
			x2 = pos2[0] - pos[0]
			y2 = pos2[1] - pos[1]
			angle = abs(math.atan2(x1 * y2 - x2 * y1, x1 * x2 + y1 * y2))
			ans[i] = angle / (2 * pi)
	for i in range(n):
		print(ans[i])


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)


import math
N = int(input())
PI = math.pi
X = []
Y = []
for i in range(N):
	(x, y) = [int(i) for i in input().split()]
	X.append(x)
	Y.append(y)
for i in range(N):
	kakudo = [math.atan2(Y[i] - Y[j], X[i] - X[j]) for j in range(N) if j != i]
	kakudo.sort()
	kmax = 0
	if N == 2:
		kmax = 2 * PI
	else:
		for j in range(N - 2):
			kmax = max(kmax, kakudo[j + 1] - kakudo[j])
			kmax = max(kmax, kakudo[0] + 2 * PI - kakudo[N - 2])
	print(max(0, kmax - PI) / (2 * PI))


N = int(input())
P = [list(map(int, input().split())) for i in range(N)]
MP = {tuple(p): i for (i, p) in enumerate(P)}

def cross(C, A, B):
	return (C[0] - A[0]) * (C[1] - B[1]) - (C[1] - A[1]) * (C[0] - B[0])

def convex_hull(P):
	P.sort()
	Q = []
	for p in P:
		while 1 < len(Q) and cross(Q[-2], Q[-1], p) >= 0:
			Q.pop()
		Q.append(p)
	k = len(Q)
	for p in reversed(P[:-1]):
		while k < len(Q) and cross(Q[-2], Q[-1], p) >= 0:
			Q.pop()
		Q.append(p)
	return Q
from math import atan2, pi
Q = convex_hull(P)[:-1]
K = len(Q)
ans = [0.0] * N
for i in range(K):
	S = Q[i - 1]
	T = Q[i]
	U = Q[(i + 1) % K]
	X0 = T[0] - S[0]
	X1 = U[0] - T[0]
	Y0 = T[1] - S[1]
	Y1 = U[1] - T[1]
	ans[MP[tuple(Q[i])]] = atan2(X1 * Y0 - X0 * Y1, X0 * X1 + Y0 * Y1) / 2.0 / pi
print(*ans, sep='\n')


from math import atan2, pi
N = int(input())
src = [tuple(map(int, input().split())) for i in range(N)]
ptoi = {}
for (i, p) in enumerate(src):
	ptoi[p] = i
if N == 2:
	for i in range(2):
		print(0.5)
	exit()

def convex_hull(ps):
	ps.sort()

	def cross(o, a, b):
		return (a[0] - o[0]) * (b[1] - o[1]) - (a[1] - o[1]) * (b[0] - o[0])
	lower = []
	for p in ps:
		while len(lower) >= 2 and cross(lower[-2], lower[-1], p) <= 0:
			lower.pop()
		lower.append(p)
	upper = []
	for p in reversed(ps):
		while len(upper) >= 2 and cross(upper[-2], upper[-1], p) <= 0:
			upper.pop()
		upper.append(p)
	return lower[:-1] + upper[:-1]
outer = convex_hull(src)
outer += outer[:2]
ans = [0] * N
for ((y1, x1), (y2, x2), (y3, x3)) in zip(outer, outer[1:], outer[2:]):
	(dy1, dx1) = (y2 - y1, x2 - x1)
	(dy2, dx2) = (y3 - y2, x3 - x2)
	ang1 = atan2(dx1, dy1)
	ang2 = atan2(dx2, dy2)
	a = (ang2 - ang1) % (pi * 2) / (pi * 2)
	ans[ptoi[y2, x2]] = a
for a in ans:
	print(a)


from math import sqrt, pi, acos
n = int(input())
p1 = [[int(i) for i in input().split()] for i in range(n)]
(p, q, ans) = (sorted(p1), [], [])
(x1, x2, y1, y2, z1, z2) = (p[0][0], p[0][1] + 1, p[0][0], p[0][1], 10 ** 6 + 1, 0)

def cos(a, b, c, d, e, f):
	(a, b, e, f) = (a - c, b - d, e - c, f - d)
	return (a * e + b * f) / (sqrt(a ** 2 + b ** 2) * sqrt(e ** 2 + f ** 2))
while p[0] != [z1, z2]:
	q.append([y1, y2])
	num = 2
	for (i, j) in p:
		if y1 != i or y2 != j:
			m = cos(x1, x2, y1, y2, i, j)
			if num > m:
				(num, z1, z2) = (m, i, j)
	ans.append((pi - acos(max(-1, num))) / (2 * pi))
	(x1, x2, y1, y2) = (y1, y2, z1, z2)
ans = [(pi - acos(cos(x1, x2, y1, y2, q[1][0], q[1][1]))) / (2 * pi)] + ans[1:]
for i in p1:
	if i in q:
		print(ans[q.index(i)])
	else:
		print(0)


import math

def norm(p, q):
	return (q[1] - p[1], p[0] - q[0])

def magnitude(a):
	return (a[0] ** 2 + a[1] ** 2) ** 0.5

def dot(p, q):
	return p[0] * q[0] + p[1] * q[1]

def angle(p, q):
	return math.acos(dot(p, q) / (magnitude(p) * magnitude(q)))

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

def convex_hull(ps):
	ps = sorted(ps)
	qs = []
	n = len(ps)
	for p in ps:
		while len(qs) > 1 and cross(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 cross(qs[-1], qs[-2], p) > 0:
			qs.pop()
		qs.append(p)
	return qs
n = int(input())
s = [tuple(map(int, input().split())) for _ in range(n)]
ch = convex_hull(s)
ch.pop()
m = len(ch)
d = dict()
for i in range(m):
	u = angle(norm(ch[i - 1], ch[i]), norm(ch[i], ch[(i + 1) % m]))
	d[ch[i]] = u / 2 / math.pi
for t in s:
	print(0.0 if t not in d else d[t])


import math
from collections import defaultdict
n = int(input())
ps = [tuple(map(int, input().split())) for i in range(n)]

def dist(rad, p):
	radtmp = 2 * math.pi * rad / maxcut
	return -p[0] * math.cos(radtmp) - p[1] * math.sin(radtmp)

def closest(rad):
	tmp = dist(rad, ps[0])
	itmp = 0
	for (i, pp) in enumerate(ps):
		tmp2 = dist(rad, pp)
		if tmp2 < tmp:
			itmp = i
			tmp = tmp2
	return itmp
maxcut = 2 ** 20
binary = defaultdict(int)
binary[0] = closest(0)
binary[maxcut] = binary[0]
binary[maxcut // 2] = closest(maxcut // 2)
binary[maxcut // 4] = closest(maxcut // 4)
binary[3 * maxcut // 4] = closest(3 * maxcut // 4)

def fillbinary(ll, rr):
	if binary[ll] != binary[rr] and rr - ll != 1:
		mm = (ll + rr) // 2
		binary[mm] = closest(mm)
		fillbinary(ll, mm)
		fillbinary(mm, rr)
fillbinary(0, maxcut // 4)
fillbinary(maxcut // 4, maxcut // 2)
fillbinary(maxcut // 2, 3 * maxcut // 4)
fillbinary(3 * maxcut // 4, maxcut)
binkeys = sorted(binary.keys())
ansli = [0] * n
beforekey = 0
for i in binkeys:
	ansli[binary[i]] += i - beforekey
	beforekey = i
for i in range(n):
	print(ansli[i] / maxcut)


import sys
stdin = sys.stdin

def li():
	return map(int, stdin.readline().split())

def li_():
	return map(lambda x: int(x) - 1, stdin.readline().split())

def lf():
	return map(float, stdin.readline().split())

def ls():
	return stdin.readline().split()

def ns():
	return stdin.readline().rstrip()

def lc():
	return list(ns())

def ni():
	return int(stdin.readline())

def nf():
	return float(stdin.readline())
from math import acos

def ccw(p1, p2, p3):
	return (p2[0] - p1[0]) * (p3[1] - p1[1]) - (p2[1] - p1[1]) * (p3[0] - p1[0])

def ConvexHull(points):
	u = []
	l = []
	points.sort()
	for p in points:
		while len(u) > 1 and ccw(u[-2], u[-1], p) >= 0:
			u.pop()
		while len(l) > 1 and ccw(l[-2], l[-1], p) <= 0:
			l.pop()
		u.append(p)
		l.append(p)
	return u + l[-2:0:-1]

def angle(v1, v2):
	inner = v1[0] * v2[0] + v1[1] * v2[1]
	normv1 = (v1[0] ** 2 + v1[1] ** 2) ** 0.5
	normv2 = (v2[0] ** 2 + v2[1] ** 2) ** 0.5
	return acos(inner / (normv1 * normv2))
n = ni()
if n == 1:
	print(1)
elif n == 2:
	print(0.5)
	print(0.5)
else:
	points = [list(li()) + [i] for i in range(n)]
	ch = ConvexHull(points)
	bsc = []
	for i in range(len(ch)):
		(x1, y1, i1) = ch[i]
		(x2, y2, i2) = ch[i - 1]
		bsc.append((y1 - y2, x2 - x1))
	if len(ch) == 2:
		angles = [1, 1]
	else:
		angles = [angle(bsc[i], bsc[i - 1]) for i in range(len(ch))]
	sm = sum(angles)
	ans = [0] * n
	for i in range(len(ch)):
		(x, y, ind) = ch[i - 1]
		ans[ind] = angles[i] / sm
	for x in ans:
		print(x)


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
				elif 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)
examB()


from math import acos
pi = 3.141592653589793
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]
					elif 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])


import sys
from collections import Counter
from math import atan2, pi
readline = sys.stdin.readline

def cross(o, a, b):
	return (a[0] - o[0]) * (b[1] - o[1]) - (a[1] - o[1]) * (b[0] - o[0])
Prob = Counter()
N = int(readline())
Points = [tuple(map(int, readline().split())) for _ in range(N)]
Pointsorig = Points[:]
Points.sort()
lower = []
for p in Points:
	while len(lower) >= 2 and cross(lower[-2], lower[-1], p) < 0:
		lower.pop()
	lower.append(p)
upper = []
for p in Points[::-1]:
	while len(upper) >= 2 and cross(upper[-2], upper[-1], p) < 0:
		upper.pop()
	upper.append(p)
convexhull = lower[1:-1] + upper
M = len(convexhull)
convexhull += [convexhull[0]]
convexhull += [convexhull[1]]
for i in range(1, M + 1):
	pn = convexhull[i]
	A = (convexhull[i - 1][1] - pn[1], convexhull[i - 1][0] - pn[0])
	B = (convexhull[i + 1][1] - pn[1], convexhull[i + 1][0] - pn[0])
	theta = abs(pi - abs(atan2(*A) - atan2(*B)))
	Prob[pn] = theta / (2 * pi)
Ans = [0] * N
for i in range(N):
	Ans[i] = Prob[Pointsorig[i]]
print('\n'.join(map(str, Ans)))


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


MIS = lambda : map(int, input().split())
from math import acos

def ccw(p1, p2, p3):
	return (p2[0] - p1[0]) * (p3[1] - p1[1]) - (p2[1] - p1[1]) * (p3[0] - p1[0])

def ConvexHull(p):
	U = []
	L = []
	p.sort()
	for q in p:
		while len(U) > 1 and ccw(U[-2], U[-1], q) >= 0:
			U.pop()
		while len(L) > 1 and ccw(L[-2], L[-1], q) <= 0:
			L.pop()
		U.append(q)
		L.append(q)
	return U + L[-2:0:-1]

def angle(v1, v2):
	inner = v1[0] * v2[0] + v1[1] * v2[1]
	v1s = (v1[0] ** 2 + v1[1] ** 2) ** 0.5
	v2s = (v2[0] ** 2 + v2[1] ** 2) ** 0.5
	return acos(inner / v1s / v2s)
n = int(input())
if n == 1:
	print(1)
	exit()
if n == 2:
	print(0.5)
	print(0.5)
	exit()
p = [tuple(MIS()) + (i,) for i in range(n)]
CH = ConvexHull(p)
bsc = []
for i in range(len(CH)):
	(x1, y1, i1) = CH[i]
	(x2, y2, i2) = CH[i - 1]
	bsc.append((y1 - y2, x2 - x1))
if len(CH) == 2:
	angles = [1, 1]
else:
	angles = [angle(bsc[i], bsc[i - 1]) for i in range(len(CH))]
S = sum(angles)
ans = [0] * n
for i in range(len(CH)):
	(x, y, ind) = CH[i - 1]
	ans[ind] = angles[i] / S
for x in ans:
	print(x)


from sys import exit, stderr, setrecursionlimit
from functools import reduce
from itertools import *
from collections import defaultdict
from bisect import bisect
from math import atan2, pi

def read():
	return int(input())

def reads():
	return [int(x) for x in input().split()]
setrecursionlimit(1000000)
p = []
N = read()
for _ in range(N):
	(x, y) = reads()
	p.append((x, y))
for i in range(N):
	(x, y) = p[i]
	(b1, e1) = (0, pi)
	(b2, e2) = (pi, 2 * pi)
	for j in range(N):
		if j == i:
			continue
		(z, w) = p[j]
		th = (atan2(w - y, z - x) + pi / 2) % (2 * pi)
		if th <= pi:
			b1 = max(b1, th)
			e2 = min(e2, th + pi)
		else:
			e1 = min(e1, th - pi)
			b2 = max(b2, th)
	result = (max(0, e1 - b1) + max(0, e2 - b2)) / 2 / pi
	print('{:.20f}'.format(result))


from math import atan2, degrees
N = int(input())
holes = [tuple(map(int, input().split())) for i in range(N)]
for (x, y) in holes:
	slopes = []
	for (x2, y2) in holes:
		if x == x2 and y == y2:
			continue
		slopes += [degrees(atan2(y2 - y, x2 - x))]
	aRange = [(0, 360)]
	for slope in slopes:
		f1 = (slope + 90) % 360
		t1 = (slope - 90) % 360
		if t1 == 0:
			t1 = 360
		if f1 <= t1:
			fts = [(f1, t1)]
		else:
			fts = [(0, t1), (f1, 360)]
		aRange2 = []
		for (f, t) in fts:
			for (aFr, aTo) in aRange:
				if aFr <= f:
					aFr = f
				if t <= aTo:
					aTo = t
				if aFr <= aTo:
					aRange2 += [(aFr, aTo)]
		aRange = aRange2
	ans = 0
	for (aFr, aTo) in aRange:
		ans += (aTo - aFr) / 360
	print(ans)


import math
from collections import defaultdict

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 = int(input())
point_list = []
for _ in range(N):
	(x, y) = map(int, input().split())
	point_list.append((x, y))
CH = ConvexHull(point_list)
if len(CH) == 2:
	ans = [0] * N
	ans[CH[0]] = 0.5
	ans[CH[1]] = 0.5
	for i in range(N):
		print(ans[i])
	exit()
ans = [0] * N
for i in range(len(CH)):
	(s, t, u) = (CH[i - 1], CH[i], CH[(i + 1) % len(CH)])
	(x0, y0) = point_list[s]
	(x1, y1) = point_list[t]
	(x2, y2) = point_list[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 i in range(N):
	print(ans[i])


import math
pi = math.atan(1) * 4

def andrange(a, b):
	if a == (0, 0) or b == (0, 0):
		return (0, 0)
	if a == (0, 1):
		return b
	if b == (0, 1):
		return a
	if a[0] > b[0]:
		(a, b) = (b, a)
	if b[1] < a[1]:
		return b
	if b[0] < a[1] and b[1] >= a[1]:
		return (b[0], a[1])
	if b[0] >= a[1] and b[1] < a[0] + 1:
		return (0, 0)
	if b[1] >= a[0] + 1 and b[1] < a[1] + 1:
		return (a[0], b[1] - 1)
	if b[1] >= a[0] + 1 and b[1] >= a[1] + 1:
		return a

def calcrange(P, Q):
	c = calc(P, Q)
	if c > 0:
		return (c, c + 0.5)
	else:
		return (c + 1, c + 1.5)

def calc(P, Q):
	x = P[0] - Q[0]
	y = P[1] - Q[1]
	if x == 0:
		return 0.25 if y > 0 else -0.25
	t = math.atan(y / x)
	return t / (2 * pi) if x > 0 else t / (2 * pi) % 1 - 0.5
N = int(input())
X = []
for _ in range(N):
	(x, y) = map(int, input().split())
	X.append((x, y))
A = [(0, 1) for _ in range(N)]
for i in range(N):
	for j in range(N):
		if i != j:
			A[i] = andrange(A[i], calcrange(X[i], X[j]))
for a in A:
	print('{:.20f}'.format(a[1] - a[0]))


import sys
input = sys.stdin.readline
import math
N = int(input())
XY = [list(map(int, input().split())) for _ in range(N)]
Theta = [[0, 0] for _ in range(N)]
line = True
for i in range(N - 1):
	(x1, y1) = XY[i]
	for j in range(i + 1, N):
		(x2, y2) = XY[j]
		for k in range(N):
			(x3, y3) = XY[k]
			if (y1 - y2) * (x1 - x3) != (y1 - y3) * (x1 - x2):
				line = False
				break
	if line:
		break
if line:
	for (i, (x1, y1)) in enumerate(XY):
		max_x = True
		min_x = True
		max_y = True
		min_y = True
		for (j, (x2, y2)) in enumerate(XY):
			if i == j:
				continue
			if x1 <= x2:
				max_x = False
			if x2 <= x1:
				min_x = False
			if y1 <= y2:
				max_y = False
			if y2 <= y1:
				min_y = False
		if max_x or min_x or max_y or min_y:
			Theta[i][1] = math.pi
else:
	for i in range(N - 1):
		(x1, y1) = XY[i]
		for j in range(i + 1, N):
			(x2, y2) = XY[j]
			if x1 == x2:
				all_right = True
				all_left = True
				for k in range(N):
					if k == i or k == j:
						continue
					(x3, y3) = XY[k]
					if x3 > x1:
						all_left = False
					elif x3 < x1:
						all_right = False
				if all_right:
					if y1 > y2:
						Theta[i][1] = math.pi
						Theta[j][0] = math.pi
					elif y1 < y2:
						Theta[i][0] = math.pi
						Theta[j][1] = math.pi
			else:
				all_up = True
				all_down = True
				for k in range(N):
					if k == i or k == j:
						continue
					(x3, y3) = XY[k]
					if (y3 - y1) * (x1 - x2) < (y1 - y2) * (x3 - x1):
						if x1 - x2 > 0:
							all_up = False
						elif x1 - x2 < 0:
							all_down = False
					elif (y3 - y1) * (x1 - x2) > (y1 - y2) * (x3 - x1):
						if x1 - x2 > 0:
							all_down = False
						elif x1 - x2 < 0:
							all_up = False
				if all_down:
					if x1 < x2:
						theta = math.atan2(x2 - x1, y1 - y2)
						Theta[i][0] = theta
						Theta[j][1] = theta
					else:
						theta = math.atan2(x1 - x2, y2 - y1)
						Theta[i][1] = theta
						Theta[j][0] = theta
				if all_up:
					if x1 < x2:
						theta = math.atan2(x1 - x2, y2 - y1)
						Theta[i][1] = theta
						Theta[j][0] = theta
					else:
						theta = math.atan2(x2 - x1, y1 - y2)
						Theta[i][0] = theta
						Theta[j][1] = theta
for (start, end) in Theta:
	delta = end - start
	while delta < 0:
		delta += 2 * math.pi
	while delta >= 2 * math.pi:
		delta -= 2 * math.pi
	print(delta / (2 * math.pi))


import math
from math import pi

def solve(rng_lst, N):
	pos_lst = []
	for rng in rng_lst:
		pos_lst.append((rng[0], rng[2], True))
		pos_lst.append((rng[1], rng[2], False))
	pos_lst = sorted(pos_lst, key=lambda x: x[0])
	ans = 0
	opp_lst = []
	prv = 0
	for pos in pos_lst:
		if pos[2]:
			opp_lst.append(pos[1])
		else:
			if len(opp_lst) == N - 1:
				ans += pos[0] - prv
			opp_lst.remove(pos[1])
		prv = pos[0]
	return ans / (2 * pi)
N = int(input())
x_lst = []
y_lst = []
for _ in range(N):
	(x, y) = [int(_) for _ in input().split()]
	x_lst.append(x)
	y_lst.append(y)
for i in range(N):
	rng_lst = []
	for j in range(N):
		if i != j:
			xi = x_lst[i]
			yi = y_lst[i]
			xj = x_lst[j]
			yj = y_lst[j]
			if yi == yj:
				if xi < xj:
					rng_lst.append((pi / 2, pi / 2 + pi, j))
				else:
					rng_lst.append((0, pi / 2, j))
					rng_lst.append((pi / 2 + pi, 2 * pi, j))
			else:
				k = -(xj - xi) / (yj - yi)
				xii = xi - (xi + xj) / 2
				yii = yi - (yi + yj) / 2
				at = math.atan(k)
				if at >= 0 and yii < k * xii:
					rng_lst.append((0, at, j))
					rng_lst.append((pi + at, 2 * pi, j))
				elif at >= 0 and yii > k * xii:
					rng_lst.append((at, pi + at, j))
				elif at < 0 and yii < k * xii:
					rng_lst.append((pi + at, 2 * pi + at, j))
				elif at < 0 and yii > k * xii:
					rng_lst.append((0, pi + at, j))
					rng_lst.append((2 * pi + at, 2 * pi, j))
				else:
					print(k, xii, yii, at)
					assert 0 == 1
	print(solve(rng_lst, N))


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)


import math
import random
N = int(input())
X = []
Y = []
for _ in range(N):
	(x, y) = map(int, input().split())
	X.append(x)
	Y.append(y)
suma = 0
for i in range(N):
	r = []
	for j in range(N):
		if i == j:
			continue
		r.append(math.atan2(Y[j] - Y[i], X[j] - X[i]))
	r.sort()
	dr = [r[i + 1] - r[i] for i in range(len(r) - 1)]
	dr.append(r[0] + 2 * math.pi - r[-1])
	print((max(dr) - math.pi) / (2 * math.pi) if max(dr) > math.pi else 0)


import math
n = int(input())
c = [[0] * 2 for i in range(n)]
a = [0] * n
p = math.pi
for i in range(n):
	(c[i][0], c[i][1]) = map(float, input().split())

def f(ax, ay, bx, by, cx, cy):
	vx = ax - cx
	vy = ay - cy
	wx = bx - cx
	wy = by - cy
	s = 1
	if vx * wy - vy * wx < 0:
		s = -1
	p = vx * wx + vy * wy
	q = (vx * vx + vy * vy) ** 0.5
	r = (wx * wx + wy * wy) ** 0.5
	t = p / (q * r)
	t = max(-1, min(1, t))
	t = math.acos(t) * s
	return t
for i in range(n):
	k = (i + 1) % n
	tax = 0
	tin = 0
	for j in range(n):
		if j != i and j != k:
			t = f(c[k][0], c[k][1], c[j][0], c[j][1], c[i][0], c[i][1])
			tax = max(tax, t)
			tin = min(tin, t)
	if tax - tin < p:
		a[i] = (p - tax + tin) / (p * 2)
for i in range(n):
	print(round(a[i], 6))


import math
N = int(input())
xys = [tuple(map(int, input().split())) for _ in range(N)]
if N == 2:
	print(0.5)
	print(0.5)
	exit()
outside = [min(range(N), key=lambda i: xys[i])]
go_back_to_while = False
while outside:
	i = outside[-1]
	(x1, y1) = xys[i]
	for j in range(N):
		if j in outside:
			continue
		(x2, y2) = xys[j]
		sign = 0
		for (k, (x3, y3)) in enumerate(xys):
			if k == i or k == j:
				continue
			tmp = (x2 - x1) * (y3 - y1) - (y2 - y1) * (x3 - x1)
			if tmp == 0:
				if x1 < x3 < x2 or x1 > x3 > x2 or y1 < y3 < y2 or (y1 > y3 > y2):
					if k in outside:
						outside.remove(k)
						outside.append(j)
						go_back_to_while = True
						break
				elif x1 < x2 < x3 or x1 > x2 > x3 or y1 < y2 < y3 or (y1 > y2 > y3):
					break
				else:
					outside.pop()
					go_back_to_while = True
					break
			elif tmp > 0:
				if sign == 0:
					sign = +1
				elif sign == -1:
					break
				else:
					continue
			elif sign == 0:
				sign = -1
			elif sign == +1:
				break
			else:
				continue
		else:
			outside.append(j)
			break
		if go_back_to_while:
			go_back_to_while = False
			break
	else:
		break
ans = [0.0] * N
for i in range(-1, len(outside) - 1):
	(x1, y1) = xys[outside[i - 1]]
	(x2, y2) = xys[outside[i]]
	(x3, y3) = xys[outside[i + 1]]
	(v1x, v1y) = (x2 - x1, y2 - y1)
	(v2x, v2y) = (x3 - x2, y3 - y2)
	dot = v1x * v2x + v1y * v2y
	len1 = v1x ** 2 + v1y ** 2
	len2 = v2x ** 2 + v2y ** 2
	ans[outside[i]] = math.acos(max(-1.0, min(1.0, dot / math.sqrt(len1 * len2)))) / (2 * math.pi)
for a in ans:
	print('{:.20f}'.format(a))


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


from math import pi, atan2
q = 2 * pi

def deg(a, b):
	d = b - a
	t = atan2(d.real, d.imag)
	if t < 0:
		t += q
	return t
n = int(input())
cs = []
for _ in range(n):
	(a, b) = map(int, input().split())
	cs += [complex(a, b)]
for i in range(n):
	args = [deg(cs[i], cs[j]) / q for j in range(n) if j != i]
	args = sorted(args)
	dif = [args[i] - args[i - 1] for i in range(n - 1)]
	dif[0] += 1
	print(max(max(dif) - 1 / 2, 0))


import math
n = int(input())
l = [list(map(int, input().split())) for i in range(n)]
pi = math.pi
hl = [[pi, 0, 0, -pi] for i in range(n)]
for i in range(n):
	(x1, y1) = l[i]
	for j in range(i + 1, n):
		(x2, y2) = l[j]
		if x1 == x2:
			if y1 > y2:
				hl[i][3] = 0
				hl[j][0] = 0
			else:
				hl[i][0] = 0
				hl[j][3] = 0
		else:
			r = math.atan((y2 - y1) / (x2 - x1)) + pi / 2
			if x2 > x1:
				hl[j][3] = max(hl[j][3], r - pi)
				hl[j][0] = min(hl[j][0], r)
				hl[i][1] = max(hl[i][1], r)
				hl[i][2] = min(hl[i][2], r - pi)
			else:
				hl[i][3] = max(hl[i][3], r - pi)
				hl[i][0] = min(hl[i][0], r)
				hl[j][1] = max(hl[j][1], r)
				hl[j][2] = min(hl[j][2], r - pi)
for i in hl:
	(a, b, c, d) = i
	print((max(0, a - b) + max(0, c - d)) / (2 * pi))