Language: C++

#pragma GCC optimize("O3")
#include <bits/stdc++.h>
 
using namespace std;
#define endl '\n'
#define what_is(x) cerr << #x << " is " << x << endl;
#define ll long double
#define int long double
#define ld long double
#define pii pair<int,int>
#define rand() abs((rand()<<15)|rand())
#define randll() abs(((long long)rand()<<30)|rand())
const int INF = 1000000001;
const int MOD = 1000000007;
const int MAXN = 200000;
 
/*------------------------GEOMETRY------------------------*/
/*-------------------------POINTS-------------------------*/
// NOTE: All Angles are in Radians
#define PI 3.1415926535897932384
#define EPS (1e-7)
#define point complex<ld>
#define x() real()
#define y() imag()
ld toDegrees(ld radians) { return radians*(180/PI); }
ld toRadians(ld degrees) { return degrees/(180/PI); }
point toCartesian(point p) { return polar(p.x(), p.y()); }
point toPolar(point c) { return point(abs(c), arg(c)); }
ld dot(point a, point b) { return (conj(a) * b).x(); }
ld cross(point a, point b) { return (conj(a) * b).y(); }
ld eucDist(point a, point b) { return abs(a - b); }
ld manDist(point a, point b) { return norm(a - b); }
point closestPointToLine(point p, point a, point b) {
    ld norm_sq = (b-a).x()*(b-a).x() + (b-a).y()*(b-a).y();
    ld u = dot(p-a, b-a) / norm_sq;
    point c = a + (u * (b-a));
    return c;
}
ld distToLine(point p, point a, point b) {
    return eucDist(p, closestPointToLine(p, a, b));
}
ld distToLineSeg(point p, point a, point b) {
    ld norm_sq = (b-a).x()*(b-a).x() + (b-a).y()*(b-a).y();
    ld u = dot(p-a, b-a) / norm_sq;
    point c = a + (u * (b-a));
    if(u<0) c = a;
    if(u>1) c = b;
    return eucDist(p, c);
}
point midpoint(point a, point b) {
    return point((a.x()+b.x())/2, (a.y()+b.y())/2);
}
ld slope(point a, point b) { return tan(arg(b - a)); }
ld angleElevation(point a, point b) { return arg(b - a); }
ld angleABC(point a, point b, point c) {\
    return abs(remainder(arg(a-b) - arg(c-b), 2.0 * PI));
}
point rotateAboutOrigin(point a, ld theta) {
    return a * polar((ld)1.0, theta); }
point rotateAboutPoint(point a, ld theta, point p) {
    return (a-p) * polar((ld)1.0, theta) + p;
}
bool cw(point a, point b, point c) {           // turn a-b-c
    return cross(b-a, c-a)+EPS < 0;
}
bool ccw(point a, point b, point c) {          // turn a-b-c
    return cross(b-a, c-a)-EPS > 0;
}
bool collinear(point a, point b, point c) {
    return abs(cross(b-a, c-a)) <= EPS;
}
point intersection(point a, point b, point p, point q) {
    ld c1 = cross(p - a, b - a), c2 = cross(q - a, b - a);
    return (c1*q - c2*p) / (c1-c2);
}
bool compareByX(point a, point b) { // 1 if a goes before b
    if(a.x() < b.x()) return 1;
    if(a.x() == b.x() && a.y() < b.y()) return 1;
    return 0;
}
bool compareByY(point a, point b) {
    if(a.y() < b.y()) return 1;
    if(a.y() == b.y() && a.x() < b.x()) return 1;
    return 0;
}
bool angCompare(pair<ld, point> a, pair<ld, point> b) {
    if(a.first < b.first) return 1;
    if(a.first==b.first)return compareByX(a.second, b.second);
    return 0;
}
vector<point> GrahamsScan(vector<point> p) {     // O(NlogN)
    sort(p.begin(), p.end(), compareByY);  // O(N) if given in
    vector<pair<ld, point>> ang;          // c/clockwise order
    for(int i = 0; i < p.size(); i++)
        ang.push_back({angleElevation(p[0], (p[i])), p[i]});
    sort(ang.begin(), ang.end(), angCompare); // Anticlockwise
    ang.push_back(ang[0]);
    vector<point> ch;
    ch.push_back(ang[0].second), ch.push_back(ang[1].second);
    for(int i = 2; i < ang.size(); i++) {
       while(ch.size() >= 2 &&
             !ccw(ch[ch.size()-2], ch.back(), ang[i].second))
            ch.pop_back();
       ch.push_back(ang[i].second);
    }
    if(ch.back()==ch[0])
        ch.pop_back();
    return ch; // Starts with bottom left in counter clockwise
}
 
/*-------------------------LINES--------------------------*/
struct line {
    int a=1, b=1;
    ld c=0;
    ld m, m1, m2, y;
    line(ld a_, ld b_, ld c_) {
        while(abs(a_-round(a_)) > EPS ||
              abs(b_-round(b_)) > EPS) {
            a_*=10;
            b_*=10;
            c_*=10;
        }
        a=round(a_);
        b=round(b_);
        c=c_;
        int x = __gcd(a,b);
        if(x<0) x*=-1;
        a/=x;
        b/=x;
        if(b<0) a*=-1, b*=-1;
        c/=x;
        if(m2!=0) m = -(ld)a/b;
        else      m = 0;
        if(b<0) m1=a, m2=-b;
        else    m1=-a, m2=b;
        y = -c/b;
    }
    void print() {
        cerr << a << "x+" << b << "y+" << c << "=0" << endl;
    }
    void printmx() {
        cerr << "y=" << m << "x+" << y << endl;
    }
};
line pointsToLine(point a, point b) {
    ld m1=b.y()-a.y();
    ld m2=b.x()-a.x();
    return line(-m1, m2, m1*a.x()-m2*a.y());
}
line perpThroughPoint(line l, point p) {
    int m1 = l.m1;
    int m2 = l.m2;
    m1*=-1;
    swap(m1, m2);
    if(m2<0) m1*=-1, m2*=-1;
    return line(-m1, m2, (-(m1*-p.x())-(m2*p.y())));
}
bool isPara(line l, line k) { return l.a==k.a && l.b==k.b; }
bool isPerp(line l, line k) {
    return l.a==k.b && l.b==-k.a || l.a==-k.b && l.b==k.a;
}
bool onLine(point p, line l) {
    return (l.a*p.x())+(l.b*p.y()) == -l.c;
}
 
 
int n;
vector<point> listOfPoints;
 
 
signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    long long seed;
    asm("rdtsc" : "=A"(seed));
    srand(seed);
 
    cin >> n;
    for(int i = 0; i < n; i++) {
        int x, y;
        cin >> x >> y;
        listOfPoints.push_back(point(x, y));
//        cerr << angleElevation(point(20,0), listOfPoints.back()) << endl;
    }
    if(n==2) {
        cout << 0.5 << endl;
        cout << 0.5 << endl;
        return 0;
    }
 
    vector<point> tempConvHull = GrahamsScan(listOfPoints);
    vector<point> convHull;
    convHull.push_back(tempConvHull.back());
    cout << setprecision(15);
    for(auto x: tempConvHull)
        convHull.push_back(x);
    convHull.push_back(tempConvHull[0]);

//    for(auto x: convHull) cerr << x << endl;

    ld tot = 0;
 
    for(int i = 0; i < n; i++) {
        int j;
        for(j = 1; j+1 < convHull.size(); j++) {
            if(convHull[j] == listOfPoints[i]) {
                break;
            }
        }
        if(j+1 == convHull.size()) {
            cout << fixed << 0. << endl;
            continue;
        }
        cout << fixed << (PI-(angleABC(convHull[j-1], convHull[j], convHull[j+1])))/(2*PI) << endl;
        tot += (PI-(angleABC(convHull[j-1], convHull[j], convHull[j+1])))/(2*PI);
    }
}

Compiler output:
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h: In instantiation of '_EuclideanRingElement std::__gcd(_EuclideanRingElement, _EuclideanRingElement) [with _EuclideanRingElement = long double]':
a.cc:126:22:   required from here
  126 |         int x = __gcd(a,b);
      |                 ~~~~~^~~~~
/usr/include/c++/14/bits/stl_algo.h:1141:43: error: invalid operands of types 'long double' and 'long double' to binary 'operator%'
 1141 |           _EuclideanRingElement __t = __m % __n;
      |                                       ~~~~^~~~~