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: Wrong Answer)

macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String {
            bytes
                .by_ref()
                .map(|r| r.unwrap() as char)
                .skip_while(|c| c.is_whitespace())
                .take_while(|c| !c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, [ $t:tt ]) => {
        {
            let len = read_value!($next, usize);
            (0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
        }
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

#[allow(unused_imports)]
use std::cmp::{min, max};

fn main() {
    input!{
        n: usize,
        v: [(f64, f64); n]
    }
    let mut hull = convex_hull(&v);
    println!("{:?}", hull);
    {
        let h0 = hull[0];
        let h1 = hull[1];
        hull.push(h0);
        hull.push(h1);
    }
    let mut ans = vec![0.0; n];
    for i in 1..hull.len() - 1 {
        ans[hull[i]] = std::f64::consts::PI - angle(v[hull[i - 1]], v[hull[i]], v[hull[i + 1]]);
    }
    for &a in &ans {
        println!("{}", a / (2.0 * std::f64::consts::PI));
    }
}

fn angle(p1: (f64, f64), p0: (f64, f64), p2: (f64, f64)) -> f64 {
    let a = (p1.0 - p0.0).abs().hypot((p1.1 - p0.1).abs());
    let b = (p2.0 - p0.0).abs().hypot((p2.1 - p0.1).abs());
    let c2 = (p1.0 - p2.0).powi(2) + (p1.1 - p2.1).powi(2);
    ((a.powi(2) + b.powi(2) - c2) / (2.0 * a * b)).acos()
}

fn convex_hull(v: &Vec<(f64, f64)>) -> Vec<usize> {
    let mut s = 0;
    for i in 1..v.len() {
        if v[s] > v[i] {
            s = i;
        }
    }
    let mut v2: Vec<(f64, f64, usize)> = v.iter().enumerate().map(|(i, p)| (p.0, p.1, i)).collect();
    v2.sort_by(|p, q| p.0.partial_cmp(&q.0).unwrap());
    v2.sort_by(|p, q| p.1.atan2(p.0).partial_cmp(&q.1.atan2(q.0)).unwrap());
    let mut hull = vec![s];
    let mut si = 0;
    while v2[si].2 != s {
        si += 1;
    }
    let n = v2.len();
    for idx in 1..n {
        let x = v2[(idx + si) % n].0;
        let y = v2[(idx + si) % n].1;
        let i = v2[(idx + si) % n].2;
        loop {
            if hull.len() < 2 {
                hull.push(i);
                break;
            }
            let p0 = v[hull[hull.len() - 2]];
            let p1 = v[hull[hull.len() - 1]];
            if (p1.0 - p0.0) * (y - p0.1) <= (p1.1 - p0.1) * (x - p0.0) {
                hull.pop();
            } else {
                hull.push(i);
                break;
            }
        }
    }
    let mut l = hull.len();
    while l > 3 {
        let p0 = v[hull[l - 2]];
        let p1 = v[hull[l - 1]];
        if (p1.0 - p0.0) * (v[s].1 - p0.1) <= (p1.1 - p0.1) * (v[s].0 - p0.0) {
            hull.pop();
            l -= 1;
        } else {
            break;
        }
    }
    hull
}