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 <bits/stdc++.h>

using namespace std;

#define range(i, m, n) for(int i = m; i < n; i++)
#define husk(i, m, n) for(int i = m; i > n; i--)

struct P {
  long long x, y;
  int id;
  P operator - (const P & b) const {
    return P{x - b.x, y - b.y};
  }

  void operator += (const P & b) {
    x += b.x, y += b.y;
  }

  long long operator * (const P & b) const {
    return x * b.y - y * b.x;
  }

  long long operator ^ (const P & b) const {
    return x * b.x + y * b.y;
  }

  long long cross(const P & b, const P & c) const {
    return (b - *this) * (c - *this);
  }

   bool isRight() const {
    return x > 0 || (x == 0 && y > 0);
  }

  bool operator < (const P & b) const {
    if(isRight() != b.isRight())
      return isRight();
    return *this * b < 0;
  }

  bool operator == (const P & b) const {
    return make_pair(x, y) == make_pair(b.x, b.y);
  }
};

long double getAlpha(const P &a, const P &b) {
  return atan2((long double) (a * b), (long double) (a ^ b));
}

int n;

int main() {
  cout.precision(15);
  cin >> n;
  vector<P> a(n);
  range(i, 0, n) {
    cin >> a[i].x >> a[i].y;
    a[i].id = i;
  }
  if(n == 2) {
    cout << 0.5 << endl << 0.5;
    return 0;
  }
  int pos = 0;
  range(i, 0, n) if(make_pair(a[i].x, a[i].y) < make_pair(a[pos].x, a[pos].y)) pos = i;
  swap(a[0], a[pos]);
  sort(a.begin() + 1, a.end(), [&](P u, P v){return u - a[0] < v - a[0];});
  vector<P> cv;
  cv.push_back(a[0]);
  range(i, 1, n) {
    while(cv.size() >= 2 && a[i].cross(cv.back(), cv[cv.size() - 2]) <= 0) {
      cv.pop_back();
    }
    cv.push_back(a[i]);
  }
  vector<double> res(n);
  double cur = 2 * 3.14159265359;
  range(i, 0, (int) cv.size()) {
    P u = cv[(i + cv.size() - 1) % cv.size()];
    P v = cv[(i + 1) % cv.size()];
    u = u - cv[i];
    v = v - cv[i];
    long double t = getAlpha(u, v);
    t = cur / 2 - t;
    res[cv[i].id] = t / cur;
  }
  range(i, 0, n) cout << res[i] << endl;
  return 0;
}