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: Accepted)

#include <fstream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <ctime>
#include <iomanip>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <climits>
#include <bitset>
#include <cassert>

using namespace std;

const int SIZE = 1 << 17;

int pointer = SIZE;
char buffer[SIZE];

char Advance() {
    if (pointer == SIZE) {
        fread(buffer, 1, SIZE, stdin);
        pointer = 0;
    }
    return buffer[pointer++];
}

int Read() {
    int answer = 0,sign = 1;
    char ch = Advance();
    while (!isdigit(ch) && ch != '-')
        ch = Advance();
    if (ch == '-') {
        ch = Advance();
        sign = -1;
    }
    while (isdigit(ch)) {
        answer = answer * 10 + ch - '0';
        ch = Advance();
    }
    return answer * sign;
}

char ReadCh() {
    char ch = Advance();
    while (!isalpha(ch))
        ch = Advance();
    return ch;
}

const int MAXN = 100;

struct pct{
    double x, y;
    int id;

    inline bool operator < ( const pct &a ) const {
        if ( x != a.x ) {
            return ( x < a.x );
        }
        return ( y < a.y );
    }
} v[ MAXN + 1 ];

pct st[ MAXN + 1 ];
vector< pct > sol;

inline bool cw( pct a, pct b, pct c ) {
    return ( (b.x - a.x) * (c.y - b.y) - (b.y - a.y) * (c.x - b.x) <= 0 );
}

double answer[1 + MAXN];
const double PI = acos(-1);

double Angle(pct c, pct a, pct b) {
    pct e = {a.x - c.x, a.y - c.y}, f = {b.x - c.x, b.y - c.y};
    double pe = atan2(e.y, e.x), pf = atan2(f.y, f.x);
    if (pe < pf)
        swap(pe, pf);
    double alpha = min(2 * PI - (pe - pf), pe - pf);
    return PI - alpha;
}

int main() {
    //freopen("tema.in", "r", stdin);
    //freopen("tema.out", "w", stdout);
    int n,i,k=2;
    scanf("%d",&n);
    for( int i = 1; i <= n; ++ i ) {
        scanf("%lf%lf", &v[i].x, &v[i].y);
        v[i].id = i;
    }
    sort( v + 1, v + n + 1 );

    int t = 0;
    st[ ++ t ] = v[ 1 ];
    st[ ++ t ] = v[ 2 ];
    for( int i = 2; i <= n; ++ i ) {
        while ( t >= 2 && cw( st[ t - 1 ], st[ t ], v[ i ] ) ) {
            -- t;
        }
        st[ ++ t ] = v[ i ];
    }
    for( int i = 1; i <= t; ++ i ) {
        sol.push_back( st[ i ] );
    }

    t = 0;
    st[ ++ t ] = v[ n ];
    st[ ++ t ] = v[ n - 1 ];
    for( int i = n - 2; i > 0; -- i ) {
        while ( t >= 2 && cw( st[ t - 1 ], st[ t ], v[ i ] ) ) {
            -- t;
        }
        st[ ++ t ] = v[ i ];
    }

    for( int i = 2; i < t; ++ i ) {
        sol.push_back( st[ i ] );
    }

    for (int i = 0; i < sol.size(); i++) {
        int a = i - 1;
        if (a == -1)
            a = sol.size() - 1;
        int b = i + 1;
        if (b == sol.size())
            b = 0;
        answer[sol[i].id] = (Angle(sol[i], sol[b], sol[a])) / (2 * PI);
    }
    for (int i = 1; i <= n; i++)
        printf("%.7f\n", answer[i]);
    return 0;
}