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;
const double eps=1e-12;
const double INF=1e100;
const int MAX=1e2+3;
double x[MAX];
double y[MAX];
double ans[MAX];
const double PI=3.14159265359;

struct PT
{
	double x,y;
	int ind;
	PT()	{}
	PT(double x, double y,int ind) : x(x), y(y), ind(ind){}
	PT(const PT &p) : x(p.x), y(p.y) {}
	PT operator + (const PT &p)	const { return PT(x+p.x, y+p.y,0); }
	PT operator - (const PT &p)	const { return PT(x-p.x, y-p.y,0); }
	PT operator * (double c)	const { return PT(x*c, y*c,0); }
	PT operator / (double c)	const { return PT(x/c, y/c,0); }
};
double dot(PT p, PT q)		{ return p.x*q.x + p.y*q.y; }
double dist2(PT p, PT q)	{ return dot(p-q, p-q); }
double cross(PT p, PT q)	{ return p.x*q.y - p.y*q.x; }

typedef long long LL; 
typedef long double LD;
int n;

vector<PT> A,hull;
PT lower_left;

bool sorter(const PT &p, const PT &q)
{
	double cpq = cross(p-lower_left, q-lower_left);
	if(abs(cpq) < eps)
		return dist2(p, lower_left) < dist2(q, lower_left);
	return (cpq > 0);
}


void convex_hull(vector<PT>& A,vector<PT> & hull)
{
	for(int i=1;i<n;i++)
	{
		if(A[i].y<A[0].y||(A[i].y<=A[0].y&&A[i].x<A[0].x))
		{
			swap(A[i],A[0]);
		}
	}
	lower_left=A[0];
	sort(A.begin(),A.end(),sorter);//arranged in clockwise order
	
	hull.push_back(A[0]);
	hull.push_back(A[1]);
	
	int hull_sz=2;
	
	for(int i=2;i<A.size();i++)
	{
		while(hull_sz>1&&cross(hull[hull_sz-1]-hull[hull_sz-2],A[i]-hull[hull_sz-1])<=0)
		{
			hull.pop_back();
			hull_sz--;
		}
		hull.push_back(A[i]);
		hull_sz++;
	}
}

int main()
{
	int n;
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
	{
		scanf("%lf %lf",&x[i],&y[i]);
		A.push_back(PT(x[i],y[i],i));
	}
	if(n==2)
	{
		printf("0.5\n0.5");
		return 0;
	}
	convex_hull(A,hull);
	if(hull.size()==2)
	{
		ans[0]=ans[1]=0.5;
	}
	else
	{
		for(int i=0;i<hull.size();i++)
		{
			int pre=(i-1+hull.size())%(hull.size());
			int nxt=(i+1)%(hull.size());
			ans[i]=dot(hull[pre]-hull[i],hull[nxt]-hull[i])/sqrt(dist2(hull[i],hull[nxt]));
			ans[i]/=sqrt(dist2(hull[i],hull[pre]));
			ans[i]=(PI-acos(ans[i]))/(2*PI);
		//	printf("%lf %lf %lf\n",hull[i].x,hull[i].y,ans[i]);
		}
	}	
	for(int i=1;i<=n;i++)
	{
		int fnd=0;
		for(int j=0;j<hull.size();j++)
		{
			if(fabs(x[i]-hull[j].x)<=eps&&fabs(y[i]-hull[j].y)<=eps)
			{
				printf("%.10lf\n",ans[j]);
				fnd=1;
				break;
			}
		}
		if(!fnd)
		{
			//printf("cam\n");
			printf("0.000000\n");
		}
	}

}