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<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<cctype>
#define reg register
#define cal(a,b,c) ((b-a)/(c-a))
#define pre(a) ((a)>1?((a)-1):t)
#define suf(a) ((a)<t?((a)+1):1)
typedef long double ld;
const ld pi=acos(-1);
const ld eps=5e-10;
inline int read(){
	reg int x=0,f=1;reg char ch=getchar();
	for(;!isdigit(ch);f=ch=='-'?-1:1,ch=getchar());
	for(;isdigit(ch);x=(x<<3)+(x<<1)+(ch^48),ch=getchar());
	return x*f;
}
struct vec{
	ld x,y;int id;
	friend vec operator+(vec a,vec b){return (vec){a.x+b.x,a.y+b.y};}
	friend vec operator-(vec a,vec b){return (vec){a.x-b.x,a.y-b.y};}
	friend ld operator*(vec a,vec b){return a.x*b.x+a.y*b.y;}
	friend ld operator/(vec a,vec b){return a.x*b.y-a.y*b.x;}
	ld abs(){return sqrt(x*x+y*y);}
}P[105];
inline bool cmp(vec a,vec b){
	return fabs(a.x-b.x)<=eps?a.y-b.y<eps:a.x-b.x<eps;
}
int n,t,q[105];
ld ans[105];
inline int sgn(ld x){if(fabs(x)<eps)return 0;return x>0?1:-1;}
int main(){
	n=read();
	for(reg int i=1;i<=n;i++)P[i].x=read(),P[i].y=read(),P[i].id=i;
	std::sort(P+1,P+1+n,cmp);
	for(reg int i=1;i<=n;i++){
		while(t>1&&sgn(cal(P[q[t-1]],P[q[t]],P[i]))<0)t--;
		q[++t]=i;
	}
	reg int lt=t;
	for(reg int i=n-1;i;i--){
		while(t>lt&&sgn(cal(P[q[t-1]],P[q[t]],P[i]))<0)t--;
		q[++t]=i;
	}
	t--;
	for(reg int i=1;i<=t;i++){
		reg vec a=P[q[pre(i)]]-P[q[i]],b=P[q[suf(i)]]-P[q[i]];
		reg ld thita=(a*b)/(a.abs()*b.abs());
		ans[P[q[i]].id]=acos(-thita)/(2.0*pi);
	}
	for(reg int i=1;i<=n;i++)printf("%.20lf\n",(double)(ans[i]));
	return 0;
}