#P13946. [EC Final 2019] Moon

[EC Final 2019] Moon

题目描述

Let SS be a sphere with radius 11 and center (0,0,0)(0, 0, 0). Let a0,a1,,ana_0,a_1,\ldots,a_n be n+1n+1 points on the surface of SS. The positions of a1,,ana_1,\ldots,a_n are fixed while the position of a0a_0 is a uniform random point on the surface of SS. Let ff be 11 if there exists a hemisphere of SS that contains a0,,ana_0,\ldots,a_n and 00 otherwise. Calculate the expected value of ff.

输入格式

The first line contains an integer nn denoting the number of points (0n1000000\le n\le 100000).

The ii-th line of the next nn lines contains three integers x,y,zx, y, z denoting the point $a_i=\left(\frac{x}{\sqrt{x^2+y^2+z^2}}, \frac{y}{\sqrt{x^2+y^2+z^2}}, \frac{z}{\sqrt{x^2+y^2+z^2}}\right)$ (1000000x,y,z1000000,x2+y2+z20-1000000\le x, y, z\le 1000000, x^2+y^2+z^2\neq 0).

It is guaranteed that a1,,ana_1,\ldots,a_n are distinct.

输出格式

Output the answer.

The answer will be considered correct if its absolute or relative error doesn't exceed 10610 ^{-6}.

3
1 0 0
0 1 0
0 0 1
0.875000000000