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 "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "unordered_map"
#include "unordered_set"
#include "iomanip"
#include "cmath"
#include "random"
#include "bitset"
#include "cstdio"

using namespace std;

const long long int MOD = 1000000007;

long long int N, M, K, H, W, L, R;

const long double EPS = 1e-7;
const long double PI = 3.141592653589793238462643383279;

struct Coordinate {
	long double x;
	long double y;
	bool operator <(const Coordinate& c)const {
		if (y < c.y)return true;
		if (y > c.y)return false;
		if (x < c.x)return true;
		return false;
	}
	bool operator >(const Coordinate& c)const {
		if (y > c.y)return true;
		if (y < c.y)return false;
		if (x > c.x)return true;
		return false;
	}
	Coordinate operator +(const Coordinate& c)const {
		Coordinate box;
		box.x = x + c.x;
		box.y = y + c.y;
		if (abs(box.x) < EPS) {
			box.x = 0;
		}
		if (abs(box.y) < EPS) {
			box.y = 0;
		}
		return box;
	}
	Coordinate operator -(const Coordinate& c)const {
		Coordinate box;
		box.x = x - c.x;
		box.y = y - c.y;
		if (abs(box.x) < EPS) {
			box.x = 0;
		}
		if (abs(box.y) < EPS) {
			box.y = 0;
		}
		return box;
	}
	long double dot(Coordinate a) {
		return x*a.x + y*a.y;
	}
	long double det(Coordinate a) {
		return x*a.y - y*a.x;
	}
	long double dis() {
		return sqrt(x*x + y*y);
	}
};

struct Convex_hull {
	vector<Coordinate>node;
	vector<Coordinate>ret;
	bool line;
	Convex_hull(bool l) {
		line = l;
	}
	void Add_node(Coordinate n) {
		node.push_back(n);
	}
	vector<Coordinate>solve() {
		sort(node.begin(), node.end());
		int index = 0;
		int num = node.size();
		ret.resize(num * 2);
		for (int i = 0; i < num; i++) {
			if (line) {
				while (index > 1 && (ret[index - 1] - ret[index - 2]).det(node[i] - ret[index - 1]) < -EPS) {
					index--;
				}
			}
			else {
				while (index > 1 && (ret[index - 1] - ret[index - 2]).det(node[i] - ret[index - 1]) < EPS) {
					index--;
				}
			}
			ret[index++] = node[i];
		}
		int box = index;
		for (int i = num - 2; i >= 0; i--) {
			if (line) {
				while (index > box && (ret[index - 1] - ret[index - 2]).det(node[i] - ret[index - 1]) < -EPS) {
					index--;
				}
			}
			else {
				while (index > box && (ret[index - 1] - ret[index - 2]).det(node[i] - ret[index - 1]) < EPS) {
					index--;
				}
			}
			ret[index++] = node[i];
		}
		ret.resize(index - 1);
		return ret;
	}
};

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);

	cin >> N;
	cout << setprecision(20);
	vector<long double>ans(N);
	map<Coordinate, int>m;
	Convex_hull ch(false);
	for (int i = 0; i < N; i++) {
		Coordinate c;
		cin >> c.x >> c.y;
		m[c] = i;
		ch.Add_node(c);
	}
	auto node = ch.solve();
	int num = node.size();
	for (int i = 1; i <= num; i++) {
		long double theta = (node[(i - 1) % num] - node[i%num]).dot(node[(i + 1) % num] - node[i%num]) / (node[(i - 1) % num] - node[i%num]).dis() / (node[(i + 1) % num] - node[i%num]).dis();
		if (abs(1 - theta) < EPS) {
			theta = 1;
		}
		theta = acos(theta);
		if (abs(theta) < EPS) {
			theta = 0;
		}
		theta = PI - theta;
		ans[m[node[i%num]]] = theta / PI / 2;
	}
	for (auto i : ans) {
		if (abs(i) < EPS) {
			cout << 0 << endl;
		}
		else {
			cout << i << endl;
		}
	}
	return 0;
}