#include #include #include #include #include using namespace std; #define all(v) begin(v), end(v) typedef vector vi; struct pt { long long x, y; }; bool operator<(const pt &a, const pt &b) { return a.x != b.x ? a.x < b.x : a.y < b.y; } bool operator==(const pt &a, const pt &b) { return a.x == b.x && a.y == b.y; } bool operator!=(const pt &a, const pt &b) { return !(a == b); } inline pt operator+(pt p,pt q){ return {p.x+q.x,p.y+q.y}; } inline pt operator-(pt p,pt q){ return {p.x-q.x,p.y-q.y}; } inline long long operator*(pt p, pt q){ return p.x*q.x+p.y*q.y; } inline long long operator^(pt p, pt q){ return p.x*q.y-p.y*q.x; } inline long long lenSq(const pt &p) { return p*p; } // the convex hull consists of: { pts[ret[0]], pts[ret[1]], ... pts[ret.back()] } vi convexHull(const vector &pts) { if (pts.empty()) return vi(); vi ret, ord; int n = pts.size(), st = min_element(all(pts)) - pts.begin(); for (int i = 0; i < n; i++) if (pts[i] != pts[st]) ord.push_back(i); sort(all(ord), [&pts,&st] (int a, int b) { pt p = pts[a] - pts[st], q = pts[b] - pts[st]; return (p ^ q) != 0 ? (p ^ q) > 0 : lenSq(p) < lenSq(q); }); ord.push_back(st); ret.push_back(st); for (int i : ord) { // use '>' to include ALL points on the hull-line for (int s = ret.size() - 1; s > 0 && ((pts[ret[s-1]] - pts[ret[s]]) ^ (pts[i] - pts[ret[s]])) >= 0; s--) ret.pop_back(); ret.push_back(i); } ret.pop_back(); return ret; } int main() { int n; cin >> n; vector poly(n); for (pt &p : poly) cin >> p.x >> p.y; vi ch = convexHull(poly); vector CH; for (int i : ch) CH.push_back(poly[i]); n = (int) CH.size(); double result = 0.0; for (int i = 0; i < n; i++) { if (CH[i].y == 0) continue; int j = (i ? i : n) - 1; if (CH[j].y < CH[i].y) { result = max(result, atan2(CH[i].y - CH[j].y, fabs(CH[i].x - CH[j].x))); } j = (i + 1) == n ? 0 : (i + 1); if (CH[j].y < CH[i].y) { result = max(result, atan2(CH[i].y - CH[j].y, fabs(CH[i].x - CH[j].x))); } } printf("%.10f\n", result * 180.0 / acos(-1.0)); }