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 (GCC 5.4.1) (judge verdict: Wrong Answer)

#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#define ll long long
#define rep(i,l,r) for(ll i=(l);i<(r);i++)
#define INF ((1LL<<62)-(1LL<<31))
#define PI 3.14159265358979323


typedef struct point{double x,y;ll n;}P;

//凸包を求める。点の配列を引いて、凸包を構成する点のindexを求め、その要素数を返す
//O(nlogn)※誤差の扱いが雑
#define menseki(p,q)(p.x*q.y-p.y*q.x)
ll pindex[110];
int pointhikaku(const void*p,const void*q){
	//辞書順ソート
	P pp=*(P*)p,qq=*(P*)q;
	if(pp.x<qq.x)return -1;
	if(pp.x>qq.x)return  1;
	if(pp.y<qq.y)return -1;
	return 1;
} 
int pointhikaku2(const void*p,const void*q){
	//argでソート
	P pp=*(P*)p,qq=*(P*)q;
	double diff=atan2(pp.y,pp.x)-atan2(qq.y,qq.x);
	return diff>0?1:diff<0?-1:0;
}
ll totuhou(P*a,ll cnt){
	//https://www.jaist.ac.jp/~uehara/course/2014/i481f/pdf/ppt-3.pdfによる
	if(cnt<=2){
		rep(i,0,cnt)pindex[i]=i;
		return cnt;
	}
	
	P*t=(P*)malloc(cnt*sizeof(P));
	P O;
	O.x=0,O.y=0;
	rep(i,0,cnt){O.x+=a[i].x/cnt;O.y+=a[i].y/cnt;}

	rep(i,0,cnt){
		t[i].x=a[i].x-O.x;
		t[i].y=a[i].y-O.y;
		t[i].n=a[i].n;
	}

	qsort(t,cnt,sizeof(P),pointhikaku2);
	//このソートによりx軸負の位置から反時計回りに並ぶ
		
	//x軸最小の点を選ぶ
	double mx=10000000;
	ll mi;
	rep(i,0,cnt)if(t[i].x<mx){
		mx=t[i].x;
		mi=i;
	}

	ll anscnt=2;
	pindex[0]=mi;
	pindex[1]=(mi+1)%cnt;
	rep(i,2,cnt+1){
		//リストの最後の2つと今見てる点の3つが凸orリストが1点　になるまで点を削除
		//Oの反時計回り順にある3点ABCが凸⇔△OAB+△OBC>△OAC
		while(anscnt>=2){
			ll a=pindex[anscnt-2];
			ll b=pindex[anscnt-1];
			ll c=(mi+i)%cnt;
			if(menseki(t[a],t[b])+menseki(t[b],t[c])>menseki(t[a],t[c]))break;
			anscnt--;
		}
		pindex[anscnt++]=(mi+i)%cnt;
	}
	//全ての点が同一直線状にあるときanscnt(=リストの長さ)は2
	//そうでないとき4以上で、これは凸包を構成する点の数+1(pindex[0]==pindex[anscnt-1])
	if(anscnt>2){
		rep(i,0,anscnt)pindex[i]=t[pindex[i]].n;//元のindexに戻す
		return anscnt-1;
	}else{
		//全ての点が同一直線上
		//ソートして端の点を返す
		qsort(t,cnt,sizeof(P),pointhikaku);
		pindex[0]=t[    0].n;
		pindex[1]=t[cnt-1].n;
		return 2;
	}
}


P ppp[110];
double ans[110];

double kakudo(ll a,ll b,ll c){
	//反時計回りの3点a,b,cのなす角度を求める
	double siita=atan2(ppp[a].y-ppp[b].y,ppp[a].x-ppp[b].x)-atan2(ppp[c].y-ppp[b].y,ppp[c].x-ppp[b].x);
	while(siita>2*PI)siita-=2*PI;
	while(siita<0)siita+=2*PI;
	return siita;
}

int main(){
	int n;
	scanf("%d",&n);
	rep(i,0,n){
		int x,y;
		scanf("%d%d",&x,&y);
		ppp[i].x=x;
		ppp[i].y=y;
		ppp[i].n=i;
	}

	ll x=totuhou(ppp,n);
	rep(i,0,x){
		ll a=pindex[(i-1+x)%x];
		ll b=pindex[i];
		ll c=pindex[(i+1)%x];
		ans[b]=(PI-kakudo(a,b,c))/(2*PI);
	}
	rep(i,0,n)printf("%.9f\n",ans[i]);
	return 0;
}