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)

#[allow(unused_imports)]
use std::io::*;
#[allow(unused_imports)]
use std::str::*;
#[allow(unused_imports)]
use std::mem::*;
#[allow(unused_imports)]
use std::cmp::*;
#[allow(unused_imports)]
use std::collections::HashMap;
#[allow(unused_imports)]
use std::collections::VecDeque;
#[allow(unused_imports)]
use std::usize;

use std::f64;

#[allow(dead_code)]
fn read<T: FromStr>() -> T {
    let mut line = String::new();
    stdin().read_line(&mut line).unwrap();
    line.trim().to_string().parse().ok().unwrap()
}

#[allow(dead_code)]
fn read_cols<T: FromStr>() -> Vec<T> {
    let mut line = String::new();
    stdin().read_line(&mut line).unwrap();

    line.trim()
        .split_whitespace()
        .map(|s| s.parse().ok().unwrap())
        .collect()
}

fn find_range(i: usize, points: &Vec<(f64, f64)>) -> Option<f64> {
    let num_points = points.len();

    let mut min: f64 = 0.0;
    let mut max = 2.0 * f64::consts::PI;

    for j in 0..num_points {
        if j == i {
            continue;
        }

        let p = points[i];
        let q = points[j];

        let mid = ((p.0 + q.0) / 2.0, (p.1 + q.1) / 2.0);
        let gradient = if p.1 == q.1 {
            f64::INFINITY
        } else {
            -(p.0 - q.0) / (p.1 - q.1)
        };

        let is_upper = p.1 - mid.1 >= gradient * (p.0 - mid.0);
        let r = gradient.atan();

        let (mut r_min, mut r_max) = if is_upper {
            (r, r + f64::consts::PI)
        } else {
            (r - f64::consts::PI, r)
        };

        if r_min < 0.0 {
            r_min += 2.0 * f64::consts::PI;
            r_max += 2.0 * f64::consts::PI;
        }

        if j == 0 || (j == 1 && i == 0) {
            // first
            min = r_min;
            max = r_max;
            continue;
        }

        // find shared
        if r_min <= min {
            if r_max >= max {
                // no update
                continue;
            } else if min <= r_max {
                max = r_max;
                continue;
            } else if max < r_min + 2.0 * f64::consts::PI {
                // no shared
                return None;
            } else {
                min = r_min;
                max -= 2.0 * f64::consts::PI;
                continue;
            }
        } else if r_min <= max {
            min = r_min;
            continue;
        } else if min > r_max - 2.0 * f64::consts::PI {
            // no shared
            return None;
        } else if max >= r_max - 2.0 * f64::consts::PI {
            max = r_max - 2.0 * f64::consts::PI;
            continue;
        } else {
            // no update
            continue;
        }
    }

    Some((max - min) / (2.0 * f64::consts::PI))
}

fn main() {
    let num_points = read::<usize>();
    let mut points = Vec::with_capacity(num_points);
    for _ in 0..num_points {
        let p = read_cols::<f64>();
        points.push((p[0], p[1]));
    }

    for i in 0..num_points {
        match find_range(i, &points) {
            Some(p) => println!("{}", p),
            None => println!("0"),
        }
    }
}