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 (Clang 3.8.0) (judge verdict: Wrong Answer)

#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <set>
#include <ctime>
#include <cstdlib>
using namespace std;

const int MAX_N = 1000 + 10;
const double pi = acos(-1.0);
const double eps = 1e-8;

int dcmp(double x) {
    if (fabs(x) < eps) return 0;
    else return x < 0 ? -1 : 1;
}

struct Point {
    int id;
    double x, y;
    Point(double x=0, double y=0):x(x), y(y) {}
    Point(int id, double x=0, double y=0):id(id), x(x), y(y) {}
    bool operator < (const Point& rhs) const {
        if (dcmp(x - rhs.x) == 0) return y < rhs.y;
        return x < rhs.x;
    }
} ps[MAX_N], ch[MAX_N];

typedef Point Vector;
typedef pair<int, int> pii;

Vector operator - (Point A, Point B) {
    return Vector(A.x - B.x, A.y - B.y);
}

double Cross(Vector A, Vector B) {
    return A.x * B.y - A.y * B.x;
}

double Dot(Vector A, Vector B) {
    return A.x * B.x + A.y * B.y;
}

double Length(Vector A) {
    return sqrt(Dot(A, A));
}

double Angle(Vector A, Vector B) {
    return acos(Dot(A, B) / Length(A) / Length(B));
}

int ConvexHull(Point* p, int n, Point* ch) {
    sort(p, p + n);
    int m = 0;
    for (int i = 0; i < n; i++) {
        while (m > 1 && dcmp(Cross(ch[m - 1] - ch[m - 2], p[i] - ch[m - 2])) <= 0) m--;
        ch[m++] = p[i];
    }
    int k = m;
    for (int i = n - 2; i >= 0; i--) {
        while (m > k && dcmp(Cross(ch[m - 1] - ch[m - 2], p[i] - ch[m - 2])) <= 0) m--;
        ch[m++] = p[i];
    }
    if (n > 1) m--;
    return m;
}

double ans[MAX_N];

int main() {
    int n = 0;
    scanf("%d", &n);
    double x, y;
    for (int i = 0; i < n; i++) {
        scanf("%lf%lf", &x, &y);
        ans[i] = 0.0;
        ps[i] = Point(i, x, y);
    }
    if (n == 2) {
        ans[ps[0].id] = ans[ps[1].id] = 1;
    } else {
        int m = ConvexHull(ps, n, ch);
        for (int i = 0; i < m; i++) {
            int j = (i - 1 + m) % m;
            int k = (i + 1) % m;
            Vector v1 = ch[j] - ch[i];
            Vector v2 = ch[k] - ch[i];
            ans[ch[i].id] = pi - fabs(Angle(v1, v2));
        }
    }
    double sum = 0.0;
    for (int i = 0; i < n; i++) sum += ans[i];
    for (int i = 0; i < n; i++) ans[i] /= sum;
    for (int i = 0; i < n; i++) {
        printf("%.30f\n", ans[i]);
    }
    return 0;
}