Flatland has recently introduced a new type of an eye check for the driver's licence. The check goes like that: there is a plane with mannequins standing on it. You should tell the value of the minimum angle with the vertex at the origin of coordinates and with all mannequins standing inside or on the boarder of this angle. 

As you spend lots of time "glued to the screen", your vision is impaired. So you have to write a program that will pass the check for you.


-----Input-----

The first line contains a single integer n (1 ≤ n ≤ 10^5) — the number of mannequins.

Next n lines contain two space-separated integers each: x_{i}, y_{i} (|x_{i}|, |y_{i}| ≤ 1000) — the coordinates of the i-th mannequin. It is guaranteed that the origin of the coordinates has no mannequin. It is guaranteed that no two mannequins are located in the same point on the plane.


-----Output-----

Print a single real number — the value of the sought angle in degrees. The answer will be considered valid if the relative or absolute error doesn't exceed 10^{ - 6}. 


-----Examples-----
Input
2
2 0
0 2

Output
90.0000000000

Input
3
2 0
0 2
-2 2

Output
135.0000000000

Input
4
2 0
0 2
-2 0
0 -2

Output
270.0000000000

Input
2
2 1
1 2

Output
36.8698976458



-----Note-----

Solution for the first sample test is shown below:  [Image] 

Solution for the second sample test is shown below:  [Image] 

Solution for the third sample test is shown below:  [Image] 

Solution for the fourth sample test is shown below:  $\#$

Difficulty: MEDIUM_HARD
Tags: Geometry

Mathematics

Complete search
Skill types: Complete search

Starter code:

Solutions:
t = int(input())
import math
an = []
ep = 10 ** (-16)
for _ in range(t):
	(x, y) = list(map(int, input().split()))
	if x > 0 and y > 0:
		an.append(180 * math.atan(abs(y) / (abs(x) + ep)) / math.pi)
	elif x < 0 and y > 0:
		an.append(180 - 180 * math.atan(abs(y) / (abs(x) + ep)) / math.pi)
	elif x < 0 and y < 0:
		an.append(180 + 180 * math.atan(abs(y) / (abs(x) + ep)) / math.pi)
	elif x > 0 and y < 0:
		an.append(360 - 180 * math.atan(abs(y) / (abs(x) + ep)) / math.pi)
	elif x == 0 and y > 0:
		an.append(90.0)
	elif x == 0 and y < 0:
		an.append(270.0)
	elif x > 0 and y == 0:
		an.append(0.0)
	elif x < 0 and y == 0:
		an.append(180.0)
	else:
		print('yah na shit')
an.sort()
an = [-360.0 + an[-1]] + an
dif = []
for i in range(t):
	dif.append(an[i + 1] - an[i])
print(360.0 - max(dif))


t = []
from math import pi
from math import atan

def f(x, y):
	if y == 0:
		if x > 0:
			return 0
		else:
			return pi
	if x == 0:
		if y > 0:
			return pi / 2
		else:
			return 3 * pi / 2
	if x > 0 and y > 0:
		return atan(y / x)
	if x < 0 and y < 0:
		return pi + atan(y / x)
	if x > 0 and y < 0:
		return 2 * pi + atan(y / x)
	if x < 0 and y > 0:
		return pi + atan(y / x)

def g(x, y):
	return 180 * f(x, y) / pi
for i in range(int(input())):
	(x, y) = list(map(int, input().split(' ')))
	t.append(g(x, y))
t.sort()
m = t[-1] - t[0]
for i in range(1, len(t)):
	m = min(m, 360 - (t[i] - t[i - 1]))
print(m)


from sys import stdin
from math import atan2, pi, degrees

def main():
	num_points = int(stdin.readline())
	angles = []
	for point in range(num_points):
		(x, y) = map(int, stdin.readline().split())
		angles.append(atan2_deg(y, x))
	angles = sorted(angles)
	best = abs(angles[-1] - angles[0])
	for i in range(1, num_points):
		best = min(best, 360.0 - abs(angles[i] - angles[i - 1]))
	print(best)

def atan2_deg(y, x):
	return degrees(atan2(y, x) + pi)
main()


from sys import stdin
import math
N = int(stdin.readline())
a = []
for n in range(N):
	(x, y) = map(int, stdin.readline().split())
	a.append((math.atan2(y, x) + 2 * math.pi) % (2 * math.pi))
a.sort()
a.append(a[0] + 2 * math.pi)
max_gap = max((a[i] - a[i - 1] for i in range(1, len(a))))
print(360 - 180 * max_gap / math.pi)


import math

def Q(x, y):
	if x == 0:
		if y > 0:
			return math.pi / 2
		if y < 0:
			return math.pi / 2 * 3
	m = abs(y / x)
	theta = math.atan(m)
	if y >= 0 and x >= 0:
		return theta
	if y >= 0 and x <= 0:
		return math.pi - theta
	if y <= 0 and x <= 0:
		return math.pi + theta
	else:
		return 2 * math.pi - theta
n = int(input())
P = []
for i in range(n):
	(x, y) = map(int, input().split())
	P.append(Q(x, y))
P.sort()
ans = 360
for i in range(1, n):
	ans = min(ans, math.pi * 2 - (P[i] - P[i - 1]))
ans = min(ans, P[n - 1] - P[0])
print(ans * 360 / (2 * math.pi))


from math import atan2, pi
n = int(input())
a = [list(map(int, input().split())) for i in range(n)]
a = sorted((atan2(y, x) for (x, y) in a))
d = [a[i + 1] - a[i] for i in range(n - 1)]
d.append(2 * pi - a[n - 1] + a[0])
print(360 - 180 * max(d) / pi)


import math
from math import atan2 as t
a = []
for i in range(int(input())):
	(x, y) = map(int, input().split())
	a.append(180 * t(y, x) / math.pi)
a.sort()
ans = a[-1] - a[0]
for i in range(len(a) - 1):
	ans = min(ans, 360 - a[i + 1] + a[i])
print(ans)


n = int(input())
t = []
from math import *
for _ in range(n):
	(a, b) = map(int, input().split())
	x = 180 * acos(a / (a * a + b * b) ** 0.5) / pi
	if b >= 0:
		t.append(x)
	else:
		t.append(360 - x)
t.sort()
t.append(t[0] + 360)
l = [t[i] - t[i - 1] for i in range(1, len(t))]
print(360 - max(l))


import os
import sys
from io import BytesIO, IOBase
from collections import Counter
import math
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)

def lcm(a, b):
	return a * b / gcd(a, b)

def ispali(k):
	return str(k) == str(k)[::-1]

def main():
	PI = math.pi
	n = int(input())
	a = []
	for i in range(n):
		(x, y) = map(int, input().split())
		ang = math.atan2(y, x) * 180 / PI
		if ang < 0:
			ang = 360 - abs(ang)
		a.append(abs(ang))
	a.sort()
	ans = float('inf')
	for i in range(n - 1, 0, -1):
		ans = min(ans, abs(360 - abs(a[i] - a[i - 1])))
	ans = min(ans, abs(abs(a[0] - a[n - 1])))
	print(ans)
	return
main()


import math
n = int(input())
points = [tuple(map(int, input().split())) for _ in range(n)]
angles = sorted([math.atan2(x, y) for (x, y) in points])
angles.append(angles[0] + 2 * math.pi)
max_angle = max([abs(a - b) for (a, b) in zip(angles[:-1], angles[1:])] + [])
print('%0.9f' % (180 * (2 * math.pi - max_angle) / math.pi))


def modinv(n, p):
	return pow(n, p - 2, p)
import math

def main():
	n = int(input())
	angles = []
	for i in range(n):
		(x, y) = [int(x) for x in input().split()]
		if x > 0 and y > 0:
			angle = math.atan(y / x)
		elif x < 0 and y > 0:
			angle = math.atan(abs(x) / abs(y)) + math.pi / 2
		elif x < 0 and y < 0:
			angle = math.atan(abs(y) / abs(x)) + math.pi
		elif x > 0 and y < 0:
			angle = math.atan(abs(x) / abs(y)) + 3 * math.pi / 2
		elif x == 0:
			if y > 0:
				angle = math.pi / 2
			else:
				angle = 3 * math.pi / 2
		elif y == 0:
			if x > 0:
				angle = 0
			else:
				angle = math.pi
		angles.append(angle * 180 / math.pi)
	angles = list(set(angles))
	angles.sort()
	n = len(angles)
	if n == 1:
		print(0)
		return
	first = 0
	last = n - 1
	ans = 360
	for i in range(n):
		cur = angles[last] - angles[first]
		if last < first:
			cur += 360
		ans = min(ans, cur)
		first = (first + 1) % n
		last = (last + 1) % n
	print(ans)
py2 = round(0.5)
if py2:
	from future_builtins import ascii, filter, hex, map, oct, zip
	range = xrange
import os, sys
from io import IOBase, BytesIO
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.getvalue())
			(self.truncate(0), self.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		if py2:
			self.write = self.buffer.write
			self.read = self.buffer.read
			self.readline = self.buffer.readline
		else:
			self.write = lambda s: self.buffer.write(s.encode('ascii'))
			self.read = lambda : self.buffer.read().decode('ascii')
			self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


n = int(input())
import math
positions = []
for __ in range(n):
	(x, y) = map(int, input().split())
	positions.append(math.atan2(y, x) * 180 / math.pi)
positions.sort()
min_width = 360.0
for i in range(n):
	start = positions[i]
	end = positions[(n - 1 + i) % n]
	if i > 0:
		end += 360
	min_width = min(min_width, end - start)
print(min_width)


from math import *
n = int(input())
pts = [list(map(float, input().split())) for _ in range(n)]
a = sorted([atan2(y, x) for (x, y) in pts])
d = [a[i] - a[i - 1] for i in range(1, len(a))]
d.append(2 * pi + a[0] - a[-1])
print(degrees(2 * pi - max(d)))


from math import pi, atan

def angle(v):
	(x, y) = v
	if x == 0:
		if y > 0:
			return pi / 2
		else:
			return 3 * pi / 2
	elif x > 0:
		if y >= 0:
			return atan(y / x)
		else:
			return 2 * pi + atan(y / x)
	else:
		return pi + atan(y / x)
n = int(input())
if n == 1:
	input()
	print(0)
else:
	l = sorted([angle((int(x) for x in input().split())) for i in range(n)])
	print(360 - 180 * max(max((j - i for (i, j) in zip(l[:-1], l[1:]))), 2 * pi + l[0] - l[-1]) / pi)


import math
n = int(input())
l = []
for _ in range(n):
	(a, b) = map(int, input().split())
	l.append((a, b))
ang = []
for i in l:
	a = float(i[0])
	b = float(i[1])
	if i[0] == 0 and i[1] == 0:
		pass
	ang.append(math.atan2(b, a))
ang = sorted(ang)
ang = [i / math.pi * 180 for i in ang]
bng = [i + 360.0 for i in ang]
ang += bng
ans = int(10000000)
for i in range(n):
	ans = min(ans, ang[i + n - 1] - ang[i])
print(ans)


def angle(v):
	(x, y) = v
	return atan2(x, y)

def main():
	n = int(input())
	import sys
	if n == 1:
		input()
		print(0)
	else:
		l = sorted((atan2(*(int(i) for i in line.split())) for line in sys.stdin))
		print(360 - 180 * max(max((j - i for (i, j) in zip(l[:-1], l[1:]))), 2 * pi + l[0] - l[-1]) / pi)
from math import pi, atan2
import doctest
main()


import math
a = -400
m = 400
n = int(input())
ang = []
for _ in ' ' * n:
	(x, y) = map(int, input().split())
	theta = 180 * math.atan2(y, x) / math.pi
	if theta > a:
		a = theta
	if theta < m:
		m = theta
	ang.append(theta)
ans = a - m
ang.sort()
for i in range(n - 1):
	ans = min(ans, 360 - (ang[i + 1] - ang[i]))
print(ans)


from sys import stdin
import functools
import math

def read():
	return list(map(int, stdin.readline().split()))
(n,) = read()
a = []
for i in range(n):
	(x, y) = read()
	a.append(math.atan2(y, x) % (2 * math.pi))
a = sorted(a)
if abs(a[0] - a[-1]) < 1e-09:
	print(0)
	return
ans = 0
for i in range(n):
	ans = max(ans, a[i] - a[i - 1])
ans = max(ans, 2 * math.pi - (a[-1] - a[0]))
print(360.0 - ans / math.pi * 180.0)


import math
N = int(input())
angles = []
for _ in range(N):
	(x, y) = map(int, input().split())
	angles.append(math.atan2(y, x))
angles.sort()
max_angle = 0
for i in range(N):
	angle = abs(angles[i] - angles[(i + 1) % N])
	if i == N - 1:
		angle = 2 * math.pi - angle
	max_angle = max(max_angle, angle)
print(360.0 - max_angle * 180 / math.pi)


import math

def angle(x, y):
	a = (x ** 2 + y ** 2) ** 0.5
	(x1, y1) = (x / a, y / a)
	my_angle = math.asin(y1)
	my_angle = 180 * my_angle / math.pi
	if x < 0:
		my_angle = 180 - my_angle
	if my_angle < 0:
		my_angle = 360 + my_angle
	return my_angle

def process(M):
	angles = []
	for (x, y) in M:
		angles.append(angle(x, y))
	answer = max(angles) - min(angles)
	angles = sorted(angles)
	for i in range(len(angles) - 1):
		a1 = angles[i]
		a2 = angles[i + 1]
		answer = min(answer, 360 - (a2 - a1))
	return answer
n = int(input())
M = []
for i in range(n):
	(x, y) = [int(c) for c in input().split()]
	M.append([x, y])
print(process(M))


import math
n = int(input())
coors = [[int(item) for item in input().split(' ')] for i in range(n)]

def get_pos(item):
	(x, y) = item
	deg = math.degrees(math.atan(abs(math.inf if x == 0 else y / x)))
	if y < 0:
		if x >= 0:
			return 360 - deg
		else:
			return 180 + deg
	elif x >= 0:
		return deg
	else:
		return 180 - deg
angles = [get_pos(item) for item in coors]
angles.sort()
t = [angles[0] + 360 - angles[-1]]
for i in range(1, n):
	t.append(angles[i] - angles[i - 1])
print(360 - max(t))


import sys
from math import atan2, pi

def minp():
	return sys.stdin.readline().strip()

def mint():
	return int(minp())

def mints():
	return map(int, minp().split())

def solve():
	n = mint()
	if n == 1:
		print(0)
		return
	p = [0] * n
	for i in range(n):
		(x, y) = mints()
		p[i] = atan2(y, x)
	p.sort()
	p.append(p[0] + 2 * pi)
	r = 0
	for i in range(n):
		r = max(r, p[i + 1] - p[i])
	print(360 - r * 180 / pi)
solve()


def main():
	from sys import stdin, stdout
	from math import atan2, pi
	n = int(stdin.readline().strip())
	angles = []
	for i in range(n):
		(x, y) = map(float, stdin.readline().strip().split(' '))
		angles.append(atan2(y, x) * 180 / pi % 360)
	angles = sorted(angles)
	m = 0
	for i in range(n - 1):
		m = max(m, angles[i + 1] - angles[i])
	m = max(m, (angles[0] - angles[-1]) % 360)
	stdout.write('{:.15f}\n'.format((360 - m) % 360))
main()


from math import atan2
from math import pi
from math import degrees
n = int(input())
if n == 1:
	print(0)
	exit()
arr = []
for _ in range(n):
	(x, y) = map(int, input().split())
	arr.append(degrees(atan2(y, x)))
arr.sort()
arr.append(arr[0] + 360)
print(360 - max([arr[i + 1] - arr[i] for i in range(n)]))


import math
n = int(input())
angles = list()
for i in range(n):
	(x, y) = map(int, input().split())
	if x == 0:
		angle = 90.0
	else:
		angle = math.degrees(math.atan(abs(y) / abs(x)))
	if x <= 0 and y <= 0:
		angle = 180 + angle
	elif x < 0 and y > 0:
		angle = 180 - angle
	elif x > 0 and y < 0:
		angle = 360 - angle
	angles.append(angle)
angles = sorted(angles)
min_angle = angles[-1] - angles[0]
for i in range(n - 1):
	angle = 360 - angles[i + 1] + angles[i]
	min_angle = min(angle, min_angle)
print(min_angle)


from math import pi, atan2
n = int(input())
ang = []
for _ in range(n):
	(x, y) = [int(i) for i in input().split()]
	ang.append(atan2(x, y))
ang.sort()
ans = ang[0] + 2 * pi - ang[-1]
for i in range(1, n):
	ans = max(ans, ang[i] - ang[i - 1])
print('{:.10f}'.format(360 - ans / pi * 180))


import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from math import *
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from time import perf_counter
from fractions import Fraction
import copy
import time
starttime = time.time()
mod = int(pow(10, 9) + 7)
mod2 = 998244353

def data():
	return sys.stdin.readline().strip()

def out(*var, end='\n'):
	sys.stdout.write(' '.join(map(str, var)) + end)

def L():
	return list(sp())

def sl():
	return list(ssp())

def sp():
	return map(int, data().split())

def ssp():
	return map(str, data().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(n, val) for j in range(m)]
try:
	sys.stdin = open('input.txt', 'r')
except:
	pass

def pmat(A):
	for ele in A:
		print(*ele, end='\n')
import math
from math import atan2 as t
a = []
for i in range(int(input())):
	(x, y) = map(int, input().split())
	a.append(180 * t(y, x) / math.pi)
a.sort()
ans = a[-1] - a[0]
for i in range(len(a) - 1):
	ans = min(ans, 360 - a[i + 1] + a[i])
print(ans)
endtime = time.time()


import math
(n, max_diff) = (int(input()), 0)
values = [[int(i) for i in input().split()] for j in range(n)]
values = sorted([math.atan2(values[i][1], values[i][0]) for i in range(n)])
for i in range(n - 1):
	max_diff = max(max_diff, values[i + 1] - values[i])
max_diff = max(max_diff, 2 * math.pi - (values[-1] - values[0]))
print(360 - max_diff * 180 / math.pi)


import math
n = int(input())
a = []
for i in range(n):
	(x, y) = map(int, input().split())
	d = math.atan2(y, x)
	if d < 0:
		d += 2 * math.pi
	a.append(d)
a.sort()
ans = a[n - 1] - a[0]
for i in range(n - 1):
	ans = min(ans, 2 * math.pi + a[i] - a[i + 1])
print(ans * 57.2958)


import math
n = int(input())
angles = []
for i in range(n):
	(a, b) = map(int, input().split())
	if a == 0 and b > 0:
		angle = 90
	elif a == 0 and b < 0:
		angle = 270
	elif b == 0 and a > 0:
		angle = 0
	elif b == 0 and a < 0:
		angle = 180
	elif a < 0:
		angle = math.atan(b / a) / math.pi * 180 + 180
	else:
		angle = math.atan(b / a) / math.pi * 180
		if angle < 0:
			angle += 360
	angles.append(angle)
angles.sort()
minn = angles[-1] - angles[0]
for i in range(len(angles) - 1):
	if minn > 360 - (angles[i + 1] - angles[i]):
		minn = 360 - (angles[i + 1] - angles[i])
print(f'{minn:.10f}')


import math
import random
import heapq, bisect
import sys
from collections import deque, defaultdict
from fractions import Fraction
import sys
import threading
from collections import defaultdict
threading.stack_size(10 ** 8)
mod = 10 ** 9 + 7
mod1 = 998244353
import os
import sys
from io import BytesIO, IOBase
sys.setrecursionlimit(300000)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

class TreeNode:

	def __init__(self, k, v):
		self.key = k
		self.value = v
		self.left = None
		self.right = None
		self.parent = None
		self.height = 1
		self.num_left = 1
		self.num_total = 1

class AvlTree:

	def __init__(self):
		self._tree = None

	def add(self, k, v):
		if not self._tree:
			self._tree = TreeNode(k, v)
			return
		node = self._add(k, v)
		if node:
			self._rebalance(node)

	def _add(self, k, v):
		node = self._tree
		while node:
			if k < node.key:
				if node.left:
					node = node.left
				else:
					node.left = TreeNode(k, v)
					node.left.parent = node
					return node.left
			elif node.key < k:
				if node.right:
					node = node.right
				else:
					node.right = TreeNode(k, v)
					node.right.parent = node
					return node.right
			else:
				node.value = v
				return

	@staticmethod
	def get_height(x):
		return x.height if x else 0

	@staticmethod
	def get_num_total(x):
		return x.num_total if x else 0

	def _rebalance(self, node):
		n = node
		while n:
			lh = self.get_height(n.left)
			rh = self.get_height(n.right)
			n.height = max(lh, rh) + 1
			balance_factor = lh - rh
			n.num_total = 1 + self.get_num_total(n.left) + self.get_num_total(n.right)
			n.num_left = 1 + self.get_num_total(n.left)
			if balance_factor > 1:
				if self.get_height(n.left.left) < self.get_height(n.left.right):
					self._rotate_left(n.left)
				self._rotate_right(n)
			elif balance_factor < -1:
				if self.get_height(n.right.right) < self.get_height(n.right.left):
					self._rotate_right(n.right)
				self._rotate_left(n)
			else:
				n = n.parent

	def _remove_one(self, node):
		replacement = node.left or node.right
		if node.parent:
			if AvlTree._is_left(node):
				node.parent.left = replacement
			else:
				node.parent.right = replacement
			replacement.parent = node.parent
			node.parent = None
		else:
			self._tree = replacement
			replacement.parent = None
		node.left = None
		node.right = None
		node.parent = None
		self._rebalance(replacement)

	def _remove_leaf(self, node):
		if node.parent:
			if AvlTree._is_left(node):
				node.parent.left = None
			else:
				node.parent.right = None
			self._rebalance(node.parent)
		else:
			self._tree = None
		node.parent = None
		node.left = None
		node.right = None

	def remove(self, k):
		node = self._get_node(k)
		if not node:
			return
		if AvlTree._is_leaf(node):
			self._remove_leaf(node)
			return
		if node.left and node.right:
			nxt = AvlTree._get_next(node)
			node.key = nxt.key
			node.value = nxt.value
			if self._is_leaf(nxt):
				self._remove_leaf(nxt)
			else:
				self._remove_one(nxt)
			self._rebalance(node)
		else:
			self._remove_one(node)

	def get(self, k):
		node = self._get_node(k)
		return node.value if node else -1

	def _get_node(self, k):
		if not self._tree:
			return None
		node = self._tree
		while node:
			if k < node.key:
				node = node.left
			elif node.key < k:
				node = node.right
			else:
				return node
		return None

	def get_at(self, pos):
		x = pos + 1
		node = self._tree
		while node:
			if x < node.num_left:
				node = node.left
			elif node.num_left < x:
				x -= node.num_left
				node = node.right
			else:
				return (node.key, node.value)
		raise IndexError('Out of ranges')

	@staticmethod
	def _is_left(node):
		return node.parent.left and node.parent.left == node

	@staticmethod
	def _is_leaf(node):
		return node.left is None and node.right is None

	def _rotate_right(self, node):
		if not node.parent:
			self._tree = node.left
			node.left.parent = None
		elif AvlTree._is_left(node):
			node.parent.left = node.left
			node.left.parent = node.parent
		else:
			node.parent.right = node.left
			node.left.parent = node.parent
		bk = node.left.right
		node.left.right = node
		node.parent = node.left
		node.left = bk
		if bk:
			bk.parent = node
		node.height = max(self.get_height(node.left), self.get_height(node.right)) + 1
		node.num_total = 1 + self.get_num_total(node.left) + self.get_num_total(node.right)
		node.num_left = 1 + self.get_num_total(node.left)

	def _rotate_left(self, node):
		if not node.parent:
			self._tree = node.right
			node.right.parent = None
		elif AvlTree._is_left(node):
			node.parent.left = node.right
			node.right.parent = node.parent
		else:
			node.parent.right = node.right
			node.right.parent = node.parent
		bk = node.right.left
		node.right.left = node
		node.parent = node.right
		node.right = bk
		if bk:
			bk.parent = node
		node.height = max(self.get_height(node.left), self.get_height(node.right)) + 1
		node.num_total = 1 + self.get_num_total(node.left) + self.get_num_total(node.right)
		node.num_left = 1 + self.get_num_total(node.left)

	@staticmethod
	def _get_next(node):
		if not node.right:
			return node.parent
		n = node.right
		while n.left:
			n = n.left
		return n

class SegmentTree1:

	def __init__(self, data, default=2 ** 51, func=lambda a, b: a & b):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)

class SegmentTree:

	def __init__(self, data, default=0, func=lambda a, b: a + b):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)

class Factorial:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorials = [1, 1]
		self.invModulos = [0, 1]
		self.invFactorial_ = [1, 1]

	def calc(self, n):
		if n <= -1:
			print('Invalid argument to calculate n!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.factorials):
			return self.factorials[n]
		nextArr = [0] * (n + 1 - len(self.factorials))
		initialI = len(self.factorials)
		prev = self.factorials[-1]
		m = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * i % m
		self.factorials += nextArr
		return self.factorials[n]

	def inv(self, n):
		if n <= -1:
			print('Invalid argument to calculate n^(-1)')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		p = self.MOD
		pi = n % p
		if pi < len(self.invModulos):
			return self.invModulos[pi]
		nextArr = [0] * (n + 1 - len(self.invModulos))
		initialI = len(self.invModulos)
		for i in range(initialI, min(p, n + 1)):
			next = -self.invModulos[p % i] * (p // i) % p
			self.invModulos.append(next)
		return self.invModulos[pi]

	def invFactorial(self, n):
		if n <= -1:
			print('Invalid argument to calculate (n^(-1))!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.invFactorial_):
			return self.invFactorial_[n]
		self.inv(n)
		nextArr = [0] * (n + 1 - len(self.invFactorial_))
		initialI = len(self.invFactorial_)
		prev = self.invFactorial_[-1]
		p = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * self.invModulos[i % p] % p
		self.invFactorial_ += nextArr
		return self.invFactorial_[n]

class Combination:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorial = Factorial(MOD)

	def ncr(self, n, k):
		if k < 0 or n < k:
			return 0
		k = min(k, n - k)
		f = self.factorial
		return f.calc(n) * f.invFactorial(max(n - k, k)) * f.invFactorial(min(k, n - k)) % self.MOD

def powm(a, n, m):
	if a == 1 or n == 0:
		return 1
	if n % 2 == 0:
		s = powm(a, n // 2, m)
		return s * s % m
	else:
		return a * powm(a, n - 1, m) % m

def sort_list(list1, list2):
	zipped_pairs = zip(list2, list1)
	z = [x for (_, x) in sorted(zipped_pairs)]
	return z

def product(l):
	por = 1
	for i in range(len(l)):
		por *= l[i]
	return por

def binarySearchCount(arr, n, key):
	left = 0
	right = n - 1
	count = 0
	while left <= right:
		mid = int((right + left) / 2)
		if arr[mid] <= key:
			count = mid + 1
			left = mid + 1
		else:
			right = mid - 1
	return count

def countdig(n):
	c = 0
	while n > 0:
		n //= 10
		c += 1
	return c

def binary(x, length):
	y = bin(x)[2:]
	return y if len(y) >= length else '0' * (length - len(y)) + y

def countGreater(arr, n, k):
	l = 0
	r = n - 1
	leftGreater = n
	while l <= r:
		m = int(l + (r - l) / 2)
		if arr[m] >= k:
			leftGreater = m
			r = m - 1
		else:
			l = m + 1
	return n - leftGreater
s = []
n = int(input())
for i in range(n):
	(x, y) = map(int, input().split())
	if x == 0:
		if y > 0:
			s.append(90)
		else:
			s.append(-90)
	elif y == 0:
		if x > 0:
			s.append(0)
		else:
			s.append(180)
	elif x < 0 and y < 0:
		f = Fraction(y / x)
		s.append(180 + math.degrees(math.atan(f)))
	elif y < 0:
		f = Fraction(-y / x)
		s.append(-math.degrees(math.atan(f)))
	elif x < 0:
		f = Fraction(y / -x)
		s.append(180 - math.degrees(math.atan(f)))
	else:
		f = Fraction(y / x)
		s.append(math.degrees(math.atan(f)))
s.sort()
m = abs(s[-1] - s[0])
for i in range(1, n):
	d = 360 - abs(s[i] - s[i - 1])
	m = min(m, d)
print(m)


import sys, math
n = int(sys.stdin.readline())
points = []
for i in range(n):
	[a, b] = list(map(int, sys.stdin.readline().split()))
	points.append(math.atan2(a, b))
points = sorted(points)
diffs = []
for i in range(n):
	if i == n - 1:
		diffs.append(points[0] - points[n - 1] + 2 * math.pi)
	else:
		diffs.append(points[i + 1] - points[i])
print(360 - 180 * max(diffs) / math.pi)


import math
t = 1e-10

def angle_with_positive_x_axis(x, y):
	if y == 0:
		if x > 0:
			return 0
		else:
			return math.pi
	elif y > 0:
		return math.acos(x / abs(math.sqrt(x ** 2 + y ** 2)))
	elif y < 0:
		return 2 * math.pi - math.acos(x / abs(math.sqrt(x ** 2 + y ** 2)))
	else:
		print('TNP')

def angle(x1, y1, x2, y2):
	if x1 * x2 + y1 * y2 == 0:
		return 90
	else:
		o1 = angle_with_positive_x_axis(x1, y1)
		o2 = angle_with_positive_x_axis(x2, y2)
		o = abs(o1 - o2) * 180 / math.pi
		if o >= 180:
			return 360 - o
		else:
			return o
n = int(input())
a = []
for i in range(n):
	a.append(list(map(int, input().split(' '))))
angles = []
for i in range(n):
	angles.append(angle_with_positive_x_axis(a[i][0], a[i][1]) * 180 / math.pi)
angles.sort()
diff = []
diff.append(angles[0] + (360 - angles[-1]))
for i in range(n - 1):
	diff.append(angles[i + 1] - angles[i])
print(360 - max(diff) + t)


from math import pi, atan2
numMannequins = int(input())
coordinates = []
for i in range(numMannequins):
	coordinates.append(map(int, input().split()))
coordinates = sorted((atan2(y, x) for (x, y) in coordinates))
distance = [coordinates[i + 1] - coordinates[i] for i in range(numMannequins - 1)]
distance.append(2 * pi - coordinates[numMannequins - 1] + coordinates[0])
print(360 - 180 * (max(distance) / pi))


import os
import sys
from math import *
from collections import *
from bisect import *
from io import BytesIO, IOBase

def vsInput():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def value():
	return tuple(map(int, input().split()))

def array():
	return [int(i) for i in input().split()]

def Int():
	return int(input())

def Str():
	return input()

def arrayS():
	return [i for i in input().split()]

def slope(p):
	return degrees(atan2(p[1], p[0]))
points = []
n = Int()
for _ in range(n):
	points.append(value())
points.sort(key=slope)
angle = slope(points[0]) + 360 - slope(points[-1])
for i in range(1, n):
	an = slope(points[i]) - slope(points[i - 1])
	if an > angle:
		angle = an
print(360 - angle)


import math
n = int(input())
arr = []
pnts = list(tuple((map(int, input().split()) for _ in range(n))))
for (x, y) in pnts:
	arr.append(math.atan2(y, x) % (2 * math.pi))
arr.sort()
if abs(arr[0] - arr[-1]) < 1e-09:
	print(0)
	exit()
res = 0
for i in range(n):
	res = max(res, arr[i] - arr[i - 1])
res = max(res, 2 * math.pi - (arr[-1] - arr[0]))
print(360 - res / math.pi * 180)


from math import atan2, pi

def solve():
	n = int(input().rstrip())
	angles = []
	for _ in range(n):
		(a, b) = list(map(int, input().rstrip().split()))
		angles.append(atan2(b, a))
	angles.sort()
	maxangle = 2 * pi - (angles[n - 1] - angles[0])
	for i in range(n - 1):
		maxangle = max(angles[i + 1] - angles[i], maxangle)
	return 360 - maxangle * 180 / pi

def __starting_point():
	print(solve())
__starting_point()


from math import atan2, degrees, pi

def main():
	num_man = int(input())
	angles = []
	for n in range(num_man):
		(x, y) = input().strip().split(' ')
		(x, y) = (int(x), int(y))
		angles.append(atan2(y, x))
	angles.sort()
	max_diff = 0
	for i in range(len(angles) - 1):
		max_diff = max(max_diff, angles[i + 1] - angles[i])
	diff = angles[0] - angles[num_man - 1]
	if diff < 1e-07:
		diff += 360 * pi / 180
	max_diff = max(max_diff, diff)
	res = 360 - max_diff * 180 / pi
	print(res)
main()


from math import pi, atan2
n = int(input())
if n == 1:
	input()
	print(0)
else:
	l = sorted([atan2(*(int(x) for x in input().split())) for i in range(n)])
	print(360 - 180 * max(max((j - i for (i, j) in zip(l[:-1], l[1:]))), 2 * pi + l[0] - l[-1]) / pi)


import math
out = []
for i in range(int(input())):
	(x, y) = map(int, input().split())
	out.append(180 * (math.atan2(y, x) / math.pi))
out.sort()
res = out[-1] - out[0]
for i in range(len(out) - 1):
	res = min(res, 360 - out[i + 1] + out[i])
print(res)