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<cstdlib>
#include<iostream>
#include<vector>
#include<queue>
#include<bitset>
#include<string>
#include<stack>
#include<set>
#include<unordered_set>
#include<map>
#include<unordered_map>
#include<cstring>
#include<complex>
#include<cmath>
#include<iomanip>
#include<numeric>
#include<algorithm>
#include<list>
#include<functional>
#include<cassert>
#define mp make_pair
#define pb push_back
#define X first
#define Y second
#define y0 y12
#define y1 y22
#define INF 1987654321
#define PI 3.141592653589793238462643383279502884
#define fup(i,a,b,c) for(int (i)=(a);(i)<=(b);(i)+=(c))
#define fdn(i,a,b,c) for(int (i)=(a);(i)>=(b);(i)-=(c))
#define MEM0(a) memset((a),0,sizeof(a));
#define MEM_1(a) memset((a),-1,sizeof(a));
#define ALL(a) a.begin(),a.end()
#define SYNC ios_base::sync_with_stdio(false);cin.tie(0)
using namespace std;
typedef long long ll;
typedef long double ld;
typedef double db;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef pair<int, int> Pi;
typedef pair<ll, ll> Pll;
typedef pair<double, double> Pd;
typedef vector<int> Vi;
typedef vector<ll> Vll;
typedef vector<double> Vd;
typedef vector<Pi> VPi;
typedef vector<Pll> VPll;
typedef vector<Pd> VPd;
typedef tuple<int, int, int> iii;
typedef tuple<int,int,int,int> iiii;
typedef tuple<ll, ll, ll> LLL;
typedef vector<iii> Viii;
typedef vector<LLL> VLLL;
typedef complex<double> base;
const ll MOD = 998244353;
ll POW(ll a, ll b, ll MMM = MOD) {ll ret=1; for(;b;b>>=1,a=(a*a)%MMM)if(b&1)ret=(ret*a)% MMM; return ret; }
ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
ll lcm(ll a, ll b) { if (a == 0 || b == 0)return a + b; return a*(b / gcd(a, b)); }
int dx[] = { 0,1,0,-1,1,1,-1,-1 }, dy[] = { 1,0,-1,0,1,-1,1,-1 };

struct point {
	int x, y, p, q, i;
	point() : point(0, 0, 0, 0, -1) {}
	point(int xx, int yy) : point(xx, yy, -1) {}
	point(int xx, int yy, int ii) : point(xx, yy, 0, 0, ii) {}
	point(int xx, int yy, int pp, int qq, int ii) { x = xx, y = yy, p = pp, q = qq, i = ii; }
}p[100000];
bool f(point p1, point p2)
{
	if (1LL * p1.q*p2.p != 1LL * p1.p*p2.q)return 1LL * p1.q*p2.p < 1LL * p1.p*p2.q;
	if (p1.y != p2.y) return p1.y < p2.y;
	return p1.x < p2.x;
}
point operator - (point &p1)
{
	int xx = -p1.x, yy = -p1.y;
	return point(xx, yy);
}
point operator - (point &p1, point &p2)
{
	int xx = p1.x - p2.x, yy = p1.y - p2.y;
	return point(xx, yy);
}
bool ccw(int i, int j, int k)
{
	if (1LL * (p[j] - p[i]).x*(p[k] - p[j]).y - 1LL * (p[j] - p[i]).y*(p[k] - p[j]).x > 0)return 1;
	return 0;
}
db ans[100];
int main() {
	int n;
	scanf("%d", &n);
	if(n==2)
	{
		return !printf("%.10f\n%.10f\n",0.5,0.5);
	}
	for (int i = 0; i < n; i++)
	{
		int x, y;
		scanf("%d%d", &x, &y);
		p[i] = point(x, y, i);
	}
	sort(p, p + n, f);
	for (int i = 1; i < n; i++)
	{
		p[i].p = p[i].x - p[0].x;
		p[i].q = p[i].y - p[0].y;
	}
	sort(p + 1, p + n, f);
	Vi hull;
	hull.push_back(0);
	hull.push_back(1);
	int P = 0, Q = 1, next = 2;
	int minY = p[1].y;
	while (next < n)
	{
		while (hull.size() >= 2)
		{
			int first = hull.back();
			hull.pop_back();
			int second = hull.back();
			if (ccw(second, first, next))
			{
				hull.push_back(first);
				break;
			}
		}
		if (p[next].y < minY || (p[next].y == minY && p[next].x > p[Q].x))
		{
			minY = p[next].y;
			Q = hull.size() - 1;
		}
		hull.push_back(next++);
	}
	int N=hull.size();
	if(N==2)
	{
		bool chk[100];
		fup(i,0,N-1,1)chk[p[hull[i]].i]=1;
		fup(i,0,n-1,1)
		{
			if(chk[i])puts("0.5000000000");
			else puts("0.0000000000");
		}
		return 0;
	}
	fup(i,0,N-1,1)
	{
		int pre=(i-1+N)%N,nex=(i+1)%N;
		db x=p[hull[i]].x,y=p[hull[i]].y;
		db x1=p[hull[nex]].x,y1=p[hull[nex]].y;
		db x2=p[hull[pre]].x,y2=p[hull[pre]].y;
		db a=sqrt((x-x1)*(x-x1)+(y-y1)*(y-y1));
		db b=sqrt((x-x2)*(x-x2)+(y-y2)*(y-y2));
		db c=sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1));
		db theta=acos((a*a+b*b-c*c)/(2*a*b));
		ans[p[hull[i]].i]=(PI-theta)/(2*PI);
	}
	fup(i,0,n-1,1)printf("%.10f\n",ans[i]);
}