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 <algorithm>
#include <cassert>
#include <cstring>
#include <iostream>
#include <vector>
#include <cmath>
#include <numeric>

using namespace std;

#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define TRACE(x) cout << #x << " = " << x << endl
#define _ << " _ " <<

typedef long long llint;

struct Pt {
  int x, y, i;
};

int ccw(const Pt& a, const Pt& b, const Pt& c) {
  llint w = 0;
  w += llint(a.x) * (b.y - c.y);
  w += llint(b.x) * (c.y - a.y);
  w += llint(c.x) * (a.y - b.y);
  return w < 0 ? -1 : w > 0;
}

llint dist(const Pt& a, const Pt& b) {
  llint dx = a.x - b.x;
  llint dy = a.y - b.y;
  return dx * dx + dy * dy;
}

vector<Pt> hull(vector<Pt>& v) {
  int first = 0;
  REP(i, (int)v.size()) {
    if (make_pair(v[i].x, v[i].y) < make_pair(v[first].x, v[first].y)) first = i;
  }

  swap(v[0], v[first]);
  sort(v.begin() + 1, v.end(), [&] (const Pt& a, const Pt& b) {
      int c = ccw(v[0], a, b);
      if (c == 0) return dist(v[0], a) < dist(v[0], b);
      return c > 0;
    });

  vector<Pt> hull;
  for (auto& p: v) {
    while (hull.size() >= 2 && ccw(hull[(int)hull.size()-2], hull.back(), p) <= 0) hull.pop_back();
    hull.push_back(p);
  }
  return hull;
}

int main(void) {
  int n;
  scanf("%d", &n);
  vector<Pt> v(n);
  REP(i, n) {
    scanf("%d %d", &v[i].x, &v[i].y);
    v[i].i = i;
  }

  v = hull(v);

  vector<double> angles(n, 0);
  REP(i, (int)v.size()) {
    int p = i == 0 ? (int)v.size() - 1 : i - 1;
    int q = (i + 1) % (int)v.size();
    llint x1 = v[i].x - v[p].x;
    llint y1 = v[i].y - v[p].y;
    llint x2 = v[q].x - v[i].x;
    llint y2 = v[q].y - v[i].y;
    double cs = (x1 * x2 + y1 * y2) / sqrt(x1*x1 + y1*y1) /  sqrt(x2*x2 + y2*y2) + 1e-12;
    double angle = acos(cs);
    if (angle < 0) angle += acos(-1);
    angles[v[i].i] = angle;
  }

  double total = accumulate(angles.begin(), angles.end(), 0.0);
  REP(i, n) printf("%.12lf\n", angles[i] / total);
  return 0;
}