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 Rust (1.15.1) (judge verdict: Accepted)

fn main() {
	let mut s = String::new();
	use std::io::Read;
	std::io::stdin().read_to_string(&mut s).unwrap();
	let mut s = s.split_whitespace();
	let n: usize = s.next().unwrap().parse().unwrap();
	let mut coord: Vec<_> = (0..n).map(|i|{
		let x: i64 = s.next().unwrap().parse().unwrap();
		let y: i64 = s.next().unwrap().parse().unwrap();
		(Vec2(x, y), i)
	}).collect();
	coord.sort_by_key(|&(c, _)| (c.0 + 1000000) * 2000001 + (c.1 + 1000000));

	let mut k = 0;
	let mut ch: Vec<(Vec2<i64>, usize)> = vec![];
	for &(c, i) in coord.iter() {
		while k > 1 && (ch[k - 1].0 - ch[k - 2].0).cross(&(c - ch[k - 1].0)) <= 0 { k -= 1; }
		if k < ch.len() {
			ch[k] = (c, i);
		} else {
			ch.push((c, i));
		}
		k += 1;
	}
	let lk = k;
	for &(c, i) in coord.iter().rev().skip(1) {
		while k > lk && (ch[k - 1].0 - ch[k - 2].0).cross(&(c - ch[k - 1].0)) <= 0 { k -= 1; }
		if k < ch.len() {
			ch[k] = (c, i);
		} else {
			ch.push((c, i));
		}
		k += 1;
	}
	ch.resize(k - 1, <(Vec2<i64>, usize)>::default());
	let rad: Vec<f64> = (0..ch.len()).map(|i| (ch.get(i + 1).unwrap_or(&ch[0]).0 - ch[i].0).normal().atan()).collect();
	const TWOPI: f64 = std::f64::consts::PI * 2.;
	let prb: Vec<f64> = (0..rad.len()).map(|i| (((rad[i] - rad.get(i - 1).unwrap_or(rad.last().unwrap())) + TWOPI) % TWOPI) / TWOPI).collect();
	let mut ans: Vec<(usize, f64)> = prb.iter().zip(ch.iter()).map(|(&p, &(_, i))| (i, p)).collect();
	ans.sort_by_key(|a| a.0);
	let mut it = ans.into_iter().peekable();
	for i in 0..n {
		if let Some(&pair) = it.peek() {
			if pair.0 == i {
				println!("{}", pair.1);
				it.next();
			} else {
				println!("0");
			}
		} else {
			println!("0");
		}
	}
}

#[derive(Default, Clone, Copy)]
struct Vec2<T>(T, T);

macro_rules! impl_binops_vec2 {
	($(($op:ident, $method:ident)),+) => {$(
		impl<T: Copy + std::ops::$op<Output = T>> std::ops::$op for Vec2<T> {
			type Output = Self;
			fn $method(self, rhs: Self) -> Self::Output {
				Vec2((self.0).$method(rhs.0), (self.1).$method(rhs.1))
			}
		}
	)+};
}

macro_rules! impl_vec2_signed {
	($($T:ty),+) => {$(
		impl Vec2<$T> {
			fn normal(&self) -> Vec2<$T> {
				Vec2(-self.1, self.0)
			}
			fn cross(&self, rhs: &Self) -> $T {
				self.0 * rhs.1 - self.1 * rhs.0
			}
		}
	)+};
}

macro_rules! impl_vec2_float {
	($($Ts:ty),+; $F:ty) => {$(
		impl_vec2_float![implement $Ts, $F];
	)+};
	($($Ts:ty),+) => {$(
		impl_vec2_float![implement $Ts, $Ts];
	)+};
	(implement $T:ty, $F:ty) => {
		impl Vec2<$T> {
			fn atan(&self) -> $F {
				(self.1 as $F).atan2(self.0 as $F)
			}
		}
	};
}

impl_binops_vec2![(Sub, sub)];
impl_vec2_signed![i64];
impl_vec2_float![i64; f64];