Problem:
Score : 600 points

Problem Statement

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

Sample Input 1

2
0 0
1 1

Sample Output 1

0.5
0.5

If Ringo put Snuke in the region x+y\leq 1, Snuke will fall into the first hole. The probability of this happening is very close to 0.5.
Otherwise, Snuke will fall into the second hole, the probability of which happening is also very close to 0.5.

Sample Input 2

5
0 0
2 8
4 5
2 6
3 10

Sample Output 2

0.43160120892732328768
0.03480224363653196956
0.13880483535586193855
0.00000000000000000000
0.39479171208028279727

Solution in C++ (GCC 9.2.1) (judge verdict: Accepted)

#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
using namespace std;
typedef long long int ll;
typedef pair<int,int> PP;
#define yn {puts("Yes");}else{puts("No");}
#define MAX_N 200005

double EPS = 1e-10;

double add(double a, double b){
    if (abs(a + b) < EPS * (abs(a) + abs(b))) return 0;
    return a + b;
}

struct P {
    double x, y;
    int id;
    P() {}
    P(double x, double y) : x(x), y(y) {

    }
    P operator + (P p) {
        return P(add(x, p.x), add(y, p.y));
    }
    P operator - (P p) {
        return P(add(x, -p.x), add(y, -p.y));
    }
    P operator * (double d) {
        return P(x * d, y * d);
    }
    double dot(P p) { // 内積
        return add(x * p.x, y * p.y);
    }
    double det(P p) { // 外積
        return add(x * p.y, -y * p.x);
    }
};

bool cmp_x(const P& p, const P& q) {
    if (p.x != q.x) return p.x < q.x;
    return p.y < q.y;
}

vector<P> convex_hull (P* ps, int n) {
    sort(ps, ps + n, cmp_x);
    int k = 0;
    vector<P> qs(n * 2);
    // 下側凸包の作成
    for (int i = 0; i < n; i++) {
        while (k > 1 && (qs[k - 1] - qs[k - 2]).det(ps[i] - qs[k - 1]) <= 0) k--;
        qs[k++] = ps[i];
    }
    // 上側凸包の作成
    for (int i = n - 2, t = k; i >= 0; i--) {
        while (k > t && (qs[k - 1] - qs[k - 2]).det(ps[i] - qs[k - 1]) <= 0) k--;
        qs[k++] = ps[i];
    }
    qs.resize(k - 1);
    return qs;
}

// 点(x2,y2)の角度
double nasukaku(double x1, double y1, double x2, double y2, double x3, double y3){
    double a1 = (x1-x2), a2 = (y1-y2);
    double b1 = (x3-x2), b2 = (y3-y2);
    double costheta = (a1*b1+a2*b2)/(sqrt(a1*a1+a2*a2)*sqrt(b1*b1+b2*b2));

    double rad = acos(costheta);
    // return rad; // ラジアン
    return rad * 180.0 / M_PI; // 度数法
}

int main() {
    int n;
    cin >> n;
    P ps[n];
    rep(i,n){
        cin >> ps[i].x >> ps[i].y;
        ps[i].id = i;
    }

    vector<P> qs = convex_hull(ps, n);

    double ans[n] = {};
    int m = qs.size();
    if(qs.size()==2){
        rep(i,m) ans[qs[i].id] = 180.0;
    }else{
        qs.push_back(qs[0]);
        qs.push_back(qs[1]);
        srep(i,1,m+1){
            // cout << qs[i].id << endl;
            ans[qs[i].id] = 180.0 - nasukaku(qs[i-1].x,qs[i-1].y,qs[i].x,qs[i].y,qs[i+1].x,qs[i+1].y);
        }
    }
    rep(i,n) ans[i] /= 360.0;
    rep(i,n) cout << fixed << setprecision(10) << ans[i] << endl;
    return 0;
}