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: Accepted)

//#include "pch.h"
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>

#include <vector>
#include <set>
#include <map>
#include <iostream>
#include <utility>
#include <queue>
#include <algorithm>
#include <functional>
#include <string>

#define ll long long
#define fri(n) for(i=0;i<(n);i++)
#define frj(n) for(j=0;j<(n);i++)
#define min(p,q) ((p)<(q)?(p):(q))
#define max(p,q) ((p)>(q)?(p):(q))
#define swap(p,q) r=(p);(p)=(q);(q)=r
#define INF 1000000000000//10^12
#define INFINT 2000000001//2*10^9+1
#define MOD 1000000007
#define PI acos(-1)

using namespace std;


//void型なので返り値は無し　d[]に結果が格納されるので欲しいものをansに
int main(void)
{
	//変数の宣言
	int n;
	double x[110];
	double y[110];
	double a,b,c;
	int map[110][110];
	double slope1,slope2;
	double probab[110];

	//よく使う変数
	int i,j,k,l;
	int flag=0;
	int ans=0;
	int count=0;
	int temp,temp1,temp2;
	int max,min;
	int len;
	int sum=0;
	int ok,ng;



	//データの読み込み


	scanf("%d",&n);
//	scanf_s("%d",&n);


	for(i=0;i<n;i++){
		scanf("%lf %lf",&x[i],&y[i]);
//		scanf_s("%lf %lf",&x[i],&y[i]);
	}

	//	printf("nは%dです\n", n);
	//	printf("データの読み込み終了\n");
	//実際の処理

	for(i=0;i<n;i++){
		for(j=0;j<n;j++){
			map[i][j]=0;
		}
	}

	if(n==2){
		printf("0.5\n0.5\n");
		return 0;
	}

	for(i=0;i<n;i++){
		for(j=i+1;j<n;j++){
			a=y[j]-y[i];
			b=x[i]-x[j];
			c=x[i]*y[j]-x[j]*y[i];
			flag=0;
			for(k=0;k<n;k++){
				if(flag==0){
					if(a*x[k]+b*y[k]-c>0){
						flag=1;
					}else if(a*x[k]+b*y[k]-c<0){
						flag=-1;
					}else{
						if((x[i]-x[k])*(x[k]-x[j])<0||(y[i]-y[k])*(y[k]-y[j])<0){
							flag=-2;
							break;
						}
					}
				}else{
					if(flag==-1&&a*x[k]+b*y[k]-c>0){
						flag=-2;
						break;
					}else if(flag==1&&a*x[k]+b*y[k]-c<0){
						flag=-2;
						break;
					}else{
						if(a*x[k]+b*y[k]-c==0&&((x[i]-x[k])*(x[k]-x[j])<0||(y[i]-y[k])*(y[k]-y[j])<0)){
							flag=-2;
							break;
						}
					}
				}
			}
			if(flag==0){
				temp1=i;
				temp2=j;
				for(i=0;i<n;i++){
					if(i==temp1||i==temp2){
						printf("0.5\n");
					}else{
						printf("0\n");
					}
				}
				return 0;
			}else if(flag!=-2){
				map[i][j]=flag;
				map[j][i]=flag;
			}
		}
	}
/*	for(i=0;i<n;i++){
		for(j=0;j<n;j++){
			printf("%d ",map[i][j]);
		}
		printf("\n");
	}*/
	for(i=0;i<n;i++){
		temp1=-1;
		temp2=-1;
		temp=1;
		for(j=0;j<n;j++){
			if(abs(map[i][j])==1){
				temp=temp*map[i][j];
				temp2=temp1;
				temp1=j;
			}
		}

		if(temp1==-1){
			probab[i]=0;
			continue;
		}

		if(x[i]==x[temp1]){
			slope1=90;
		}else{
			slope1=(180/PI)*atan((y[temp1]-y[i])/(x[temp1]-x[i]));
		}
		if(x[i]==x[temp2]){
			slope2=90;
		}else{
			slope2=(180/PI)*atan((y[temp2]-y[i])/(x[temp2]-x[i]));
		}
		
		probab[i]=fabs(slope1-slope2)/360;

		if((x[temp1]-x[i])*(x[temp2]-x[i])>0){
			probab[i]=0.5-probab[i];
		}else if(x[temp1]==x[i]&&(y[i]-y[temp1])*(x[temp2]-x[i])<0){
			probab[i]=0.5-probab[i];
		}else if(x[temp2]==x[i]&&(y[i]-y[temp2])*(x[temp1]-x[i])<0){
			probab[i]=0.5-probab[i];
		}
	}


	//	printf("計算部分終了\n");

	//出力
	
	for(i=0;i<n;i++){
		printf("%1.10lf\n",probab[i]);
	}

	//	printf("結果の出力終了\n");


	return 0;
}