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++14 (GCC 5.4.1) (judge verdict: Wrong Answer)

#include <iostream>
#include <vector>
#include <cstdio>
#include <cstring>
#include <math.h>
#include <time.h>
#include <algorithm>
#include <tuple>
#define ll long long
using namespace std;

double X[111];
double Y[111];


double GetLen(double x, double y) {
    return sqrt(x*x+y*y);
}


double Sgn(double x) {
    if (x == 0)
        return 0;
    if (x > 0)
        return 1;
    else
        return -1;
}

int main() {
    int N;
    cin>>N;
    for(int i=1;i<=N;i++) {
        cin>>X[i]>>Y[i];
    }
    
    double Pi = 3.1415926535897932384626433832795028842;
    
    for(int i=1;i<=N;i++) {
        

        vector<std::tuple<ll,ll,ll>> ABC;
        
        for(int j=1;j<=N;j++) {
            if (i == j)
                continue;
            
            ll x1 = X[i];
            ll y1 = Y[i];

            
            ll x2 = X[j];
            ll y2 = Y[j];
            
            
            ll A = 2*(x2-x1);
            ll B = 2*(y2-y1);
            
            ll C = y1*y1-y2*y2+x1*x1-x2*x2;
            
            
            ABC.push_back(std::make_tuple(A,B,C));
        }
        
        long double Inf = 1e15;
        
        
        
        vector<pair<long double,long double>> pts;
        for(int j=0;j<ABC.size();j++) {
            
            double A = std::get<0>(ABC[j]);
            double B = std::get<1>(ABC[j]);
            double C = std::get<2>(ABC[j]);
            
            
            double x1,y1;
            double x2,y2;
            if (A == 0) {
                x1 = Inf;
                y1 = -C/B;
                
                x2 = -Inf;
                y2 = -C/B;
                
            } else if (B == 0) {
                y1 = Inf;
                x1 = -C/A;
                
                y2=-Inf;
                x2=-C/A;
                
            } else {
                x1 = Inf;
                y1 = -(A*x1+C)/B;
                
                x2 = -Inf;
                y2 = -(A*x2+C)/B;
            }
            
            
            
            bool ok1 = true;
            bool ok2 = true;
            for(int k=0;k<ABC.size();k++) {
                if (j == k)
                    continue;
                double Ao = std::get<0>(ABC[k]);
                double Bo = std::get<1>(ABC[k]);
                double Co = std::get<2>(ABC[k]);
                
                if (Sgn(Ao*x1+Bo*y1+Co) != Sgn(Ao*X[i]+Bo*Y[i]+Co))
                    ok1=false;
                if (Sgn(Ao*x2+Bo*y2+Co) != Sgn(Ao*X[i]+Bo*Y[i]+Co))
                    ok2=false;
                
            }
            
            
            
            if (ok1) {
                pts.push_back({x1,y1});
            } else if (ok2) {
                pts.push_back({x2,y2});
            }

        }
        
        
        
        
        if (pts.empty()) {
            printf("%1.12f\n",0.0);
        } else if (pts.size() == 1) {
            printf("%1.12f\n",0.5);
        } else {
            if (pts.size() != 2)
                exit(-1);
            
            
            double A1 = pts[0].first;
            double B1 = pts[0].second;
            
            double A2 = pts[1].first;
            double B2 = pts[1].second;
            
            
            double theta = acos((A1*A2+B1*B2)/(GetLen(A1,B1)*GetLen(A2,B2)));
            
            printf("%1.12f\n",theta/(2*Pi));
            
        }
        
        
        
        
        
        
        
    }
    
}