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 <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <set>
#include <map>
#include <queue>
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <cstring>
#include <cctype>
#include <cassert>
#include <limits>
#include <functional>
#include <iomanip>
#include <complex>
#include <bitset>
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define rer(i,l,u) for(int (i)=(int)(l);(i)<=(int)(u);++(i))
#define reu(i,l,u) for(int (i)=(int)(l);(i)<(int)(u);++(i))
#if defined(_MSC_VER) || __cplusplus > 199711L
#define aut(r,v) auto r = (v)
#else
#define aut(r,v) __typeof(v) r = (v)
#endif
#define each(it,o) for(aut(it, (o).begin()); it != (o).end(); ++ it)
#define all(o) (o).begin(), (o).end()
#define pb(x) push_back(x)
#define mp(x,y) make_pair((x),(y))
#define mset(m,v) memset(m,v,sizeof(m))
#define INF 0x3f3f3f3f3f3f3f3fLL
#define SIZE 200010

using namespace std;
typedef vector<int> vi; typedef pair<int, int> pii; typedef vector<pair<int, int> > vpii; typedef long long ll;
typedef pair<int,ll> pill; typedef pair<ll,int> plli; 
typedef pair<double, int> pdi;
template<typename T, typename U> inline void amin(T &x, U y) { if(y < x) x = y; }
template<typename T, typename U> inline void amax(T &x, U y) { if(x < y) x = y; }
typedef complex<double> P;
long long int MOD = 1000000007;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};


int N;
double pi=2.0*acos(0.0);
vector<pair<pair<double,double>,int> > data;
vi ans;
double calcvec(pair<double,double> hoge1,pair<double,double> hoge2){
	double x=hoge2.first,y=hoge2.second;
	x-=hoge1.first,y-=hoge1.second;
	double ret=acos(x/sqrt(x*x+y*y));
	if(y<0)ret=2.0*pi-ret;
	return ret;
}
double calckaku(double a,double b){
	double ret=b-a;
	if(ret<0)ret+=2.0*pi;
	return ret;
}
int main(){
	cin>>N;
	int lef=0;
	for(int i=0;i<N;i++){
		double x,y;
		cin>>x>>y;
		data.pb(mp(mp(x,y),i));
	}
	sort(data.begin(),data.end());
	reverse(data.begin(),data.end());
	int num=0,nxnum;
	double kakub=acos(0.0);
	while(1){
		nxnum=0;
		double mi=2.0*pi,kakumemo;
		for(int i=0;i<N;i++){
			if(i!=num){
				double kaku=calcvec(data[num].first,data[i].first);
				double kakuc=calckaku(kakub,kaku);
				if(kakuc<mi){
					mi=kakuc,nxnum=i,kakumemo=kaku;
				}
			}
		}
		ans.pb(num);
		kakub=kakumemo;
		if(nxnum==0)break;
		num=nxnum;
	}
	double ans2[105]={0.0};
	int n=ans.size();
	for(int i=0;i<n;i++){
		cout<<ans[i]<<endl;
	}
	for(int i=0;i<n;i++){
		int n1=ans[i],n2=ans[((i+1)%n)],n0=ans[((i+n-1)%n)];
		double ka1=calcvec(data[n1].first,data[n2].first);
		double ka2=calcvec(data[n0].first,data[n1].first);
		double ka=calckaku(ka2,ka1);
		ans2[data[ans[i]].second]=ka/(2.0*pi);
	}
	for(int i=0;i<N;i++)printf("%.7lf\n",ans2[i]);
}