import math as m
n = int(input())
a = []
for i in range(n):
x,y = map(int,input().split())
if x==0 and y==0:
theta = 0
elif x==0 or y==0:
if x==0:
if y>0:
theta = 90
else:
theta = 270
if y==0:
if x>0:
theta = 0
else:
theta = 180
elif x>=0 and y>=0:
theta = 180*m.atan(y/x)/m.pi
elif x>=0 and y<0:
theta = 360+180*m.atan(y/x)/m.pi
elif x<0 and y>=0:
theta = 180+180*m.atan(y/x)/m.pi
else:
theta = 180+180*m.atan(y/x)/m.pi
a.append(theta)
a = sorted(a)
m = len(a)
mx = 0
for i in range(1,m):
mx = max(mx,a[i]-a[i-1])
y = 360-a[-1]
x = a[0]
mx = max(mx,x+y)
print(360-mx)
// Problem: C. View Angle
// Contest: Codeforces - Codeforces Round #159 (Div. 2)
// URL: https://codeforces.com/contest/257/problem/C
// Memory Limit: 256 MB
// Time Limit: 2000 ms
/*
Author: MikiMiku
Observation:
Idea:
*/
#include <bits/stdc++.h>
using namespace std;
//#define int long long
#define endl '\n'
#define sza(x) ((int)x.size())
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define isOn(S, j) (S & (1 << j))
#define setBit(S, j) (S |= (1 << j))
#define clearBit(S, j) (S &= ~(1 << j))
#define toggleBit(S, j) (S ^= (1 << j))
#define LSB(S) (S & (-S))
#define setAll(S, n) (S = (1 << n) - 1)
#define modulo(S, N) ((S) & (N - 1)) // returns S % N, where N is a power of 2
#define isPowerOfTwo(S) (!(S & (S - 1)))
#define nearestPowerOfTwo(S) ((int)pow(2.0, (int)((log((double)S) / log(2.0)) + 0.5)))
#define turnOffLastBit(S) ((S) & (S - 1))
#define turnOnLastZero(S) ((S) | (S + 1))
#define turnOffLastConsecutiveBits(S) ((S) & (S + 1))
#define turnOnLastConsecutiveZeroes(S) ((S) | (S - 1))
typedef complex<double> point;
typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
const int MAX_N = 1e5 + 5;
const ll MOD = 1e9 + 7;
const int FMOD = 998244353;
const ll INF = 1e9;
const ld EPS = 1e-9;
const double PI=acos(-1);
#define fi first
#define se second
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector<int> vi;
typedef map<int,int> mii;
//FLOAT PRECISION SETTINGS
/*
cout.setf(ios::fixed,ios::floatfield);
cout.precision(3);
*/
//FILE IO
void setIO(string s) {
freopen((s + ".in").c_str(), "r", stdin);
freopen((s + ".out").c_str(), "w", stdout);
}
//........................................................................
signed main() {
ios_base::sync_with_stdio(0);cin.tie(nullptr); cout.tie(nullptr);
int n;
cin >> n;
if(n == 1) {
cout << 0 << endl;
return 0;
}
vector<pair<double, pair<double, double>>> P;
for(int i = 0; i < n; ++i) {
double x, y;
cin >> x >> y;
if(x > 0 && y >= 0) {
P.pb({atan(abs(y)/abs(x)), {x, y}});
} else if(x <= 0 && y > 0) {
if(x == 0) P.pb({0.5*PI, {x, y}});
else P.pb({atan(abs(x)/abs(y)) + 0.5*PI, {x, y}});
} else if(x < 0 && y <= 0) {
P.pb({atan(abs(y)/abs(x)) + PI, {x, y}});
} else {
if(x == 0) P.pb({1.5*PI, {x, y}});
else P.pb({atan(abs(x)/abs(y)) + 1.5*PI, {x, y}});
}
}
sort(all(P));
double ans = 360;
for(int i = 1; i <= n; ++i) {
double x1, y1, x2, y2;
x1 = P[i - 1].se.fi; y1 = P[i - 1].se.se;
x2 = P[i%n].se.fi; y2 = P[i%n].se.se;
//cerr << x1 << " " << y1 << " ";
/*double dot = (x1*x2) + (y1*y2);
double d1 = hypot(x1, y1);
double d2 = hypot(x2, y2);
double res = dot/(d1*d2);
double deg = (acos(res)/PI)*180;*/
//cerr << P[i%n].fi << " " << P[i - 1].fi << " ";
double deg = ((P[i%n].fi - P[i - 1].fi)/PI)*180;
//cerr << deg << endl;
if(deg < 0) deg += 360;
ans = min(360 - deg, ans);
if(n == 2) ans = min(deg, ans);
}
if(ans == 360) ans = 0;
cout.setf(ios::fixed,ios::floatfield);
cout.precision(9);
/*if(ans < EPS) {
bool colinear = true;
for(int i = 1; i < n; ++i) {
if(fabs(P[i - 1].fi - P[i].fi) >= EPS) {
colinear = false;
break;
}
}
if(!colinear) ans += 360;
}*/
cout << ans << endl;
return 0;
}
1360C - Similar Pairs | 900A - Find Extra One |
1093D - Beautiful Graph | 748A - Santa Claus and a Place in a Class |
1511B - GCD Length | 676B - Pyramid of Glasses |
597A - Divisibility | 1632A - ABC |
1619D - New Year's Problem | 242B - Big Segment |
938A - Word Correction | 159C - String Manipulation 10 |
258A - Little Elephant and Bits | 1536C - Diluc and Kaeya |
1428C - ABBB | 1557A - Ezzat and Two Subsequences |
255A - Greg's Workout | 1059A - Cashier |
1389C - Good String | 1561A - Simply Strange Sort |
1337B - Kana and Dragon Quest game | 137C - History |
1443C - The Delivery Dilemma | 6C - Alice Bob and Chocolate |
1077C - Good Array | 285B - Find Marble |
6A - Triangle | 1729A - Two Elevators |
1729B - Decode String | 1729C - Jumping on Tiles |