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;

typedef long long llint;
typedef pair<llint, llint> point;

const long double pi = 3.1415926535897932384626433L;

point O;
pair<point, int> arr[100];
point points[100];
double sol[100];
int _pos[100];
int pos[100];

#define x first
#define y second

bool ccw(const point& a, const point& b, const point& c)
{
	return (b.x - a.x) * (c.y - a.y) > (c.x - a.x) * (b.y - a.y);
}

bool cmp(const pair<point, int>& a, const pair<point, int>& b)
{
	
	bool p = a.first.y > 0 || (a.first.y == 0 && a.first.x > 0);
	bool q = b.first.y > 0 || (b.first.y == 0 && b.first.x > 0);
	if (p != q)
		return p > q;
	return ccw(O, a.first, b.first);
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	
	int n, m, i, j;
	double sum = 0;
	
	cin>>n;
	
	for (i = 0; i < n; ++i)
	{
		cin>>arr[i].first.x>>arr[i].first.y;
		arr[i].second = i;
	}
	sort(arr, arr + n, cmp);
	for (i = 0; i < n; ++i)
	{
		_pos[i] = arr[i].second;
		points[i] = arr[i].first;
	}
	
	j = 0;
	for (i = 0; i < n; ++i)
	{
		while (j >= 2 && !ccw(points[j - 2], points[j - 1], points[i]))
			--j;
		pos[j] = i;
		points[j] = points[i];
		++j;
	}
	m = j;
	
	for (i = 0; i < m; ++i)
	{
		point& a = points[(i + m - 1) % m];
		point& b = points[(i + 1) % m];
		double p = atan2(-(points[i].x - a.x), points[i].y - a.y);
		double q = atan2(-(b.x - points[i].x), b.y - points[i].y);
		double r = q - p;
		while (r < 0)
			r += 2 * pi;
		while (r >= 2 * pi)
			r -= 2 * pi;
		sol[_pos[pos[i]]] = r;
		sum += r;
	}
	
	for (i = 0; i < n; ++i)
		cout<<fixed<<setprecision(8)<<sol[i] / sum<<'\n';
}