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 Java8 (OpenJDK 1.8.0) (judge verdict: Wrong Answer)

import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.NoSuchElementException;
 
public class Main {
	private static FastScanner sc = new FastScanner();
	
	public static void main(String[] args) {
		int N = sc.nextInt();
		double[] x = new double[N];
		double[] y = new double[N];
		double minx = 10000000;
		int minpos = -1;
		for(int i=0; i<N; i++) {
			x[i] = sc.nextDouble() + 0.0000000001*i;
			y[i] = sc.nextDouble() + 0.0000000001*i;
			if(x[i] < minx) {
				minx = x[i];
				minpos = i;
			}
		}
		ArrayList<Integer> L = new ArrayList<>();
		int a = minpos;
		do {
			L.add(a);
			int b = 0;
			for(int i=1; i<N; i++) {
				int c = i;
				if(b == a) {
					b = c;
				} else {
					double v = (x[b] - x[a])*(y[c] - y[a]) - (x[c] - x[a])*(y[b] - y[a]);
					if(v > 0 || (v == 0 && (x[c] - x[a])*(x[c] - x[a]) + (y[c] - y[a])*(y[c] - y[a]) > (x[b] - x[a])*(x[b] - x[a]) + (y[b] - y[a])*(y[b] - y[a]))) {
						b = c;
					}
				}
			}
			a = b;
		} while(a != minpos);
		
		double[] p = new double[N];
		
		for(int i=0; i<L.size(); i++) {
			double ax = (x[L.get(i)] + x[L.get((i+1)%L.size())]) / 2;
			double ay = (y[L.get(i)] + y[L.get((i+1)%L.size())]) / 2;
			double bx = (x[L.get(i)] + x[L.get((i-1+L.size())%L.size())]) / 2;
			double by = (y[L.get(i)] + y[L.get((i-1+L.size())%L.size())]) / 2;
			double cos = ((ax - x[L.get(i)])*(bx - x[L.get(i)]) + (ay - y[L.get(i)])*(by - y[L.get(i)])) 
					/ Math.sqrt((ax - x[L.get(i)])*(ax - x[L.get(i)])+(ay - y[L.get(i)])*(ay - y[L.get(i)])) 
					/ Math.sqrt((bx - x[L.get(i)])*(bx - x[L.get(i)])+(by - y[L.get(i)])*(by - y[L.get(i)]));
			p[L.get(i)] = (1 - Math.acos(cos) / Math.PI)/2;
		}
		
		for(int i=0; i<N; i++) {
			System.out.println(p[i]);
		}
	}
	
	static class FastScanner {
        private final InputStream in = System.in;
        private final byte[] buffer = new byte[1024];
        private int ptr = 0;
        private int buflen = 0;
        private boolean hasNextByte() {
            if(ptr < buflen) {
                return true;
            } else {
                ptr = 0;
                try {
                    buflen = in.read(buffer);
                } catch(IOException e) {
                    e.printStackTrace();
                }
                if(buflen <= 0) {
                    return false;
                }
            }
            return true;
        }
        private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
        private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
        private void skipUnprintable() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;}
        public boolean hasNext() { skipUnprintable(); return hasNextByte();}
        public String next() {
            if (!hasNext()) throw new NoSuchElementException();
            StringBuilder sb = new StringBuilder();
            int b = readByte();
            while(isPrintableChar(b)) {
                sb.appendCodePoint(b);
                b = readByte();
            }
            return sb.toString();
        }
        public long nextLong() {
            return Long.parseLong(next());
        }
        public int nextInt(){
            return Integer.parseInt(next());
        }
        public double nextDouble(){
            return Double.parseDouble(next());
        }
    }
}