QOJ.ac

QOJ

実行時間制限: 2 s メモリ制限: 256 MB 満点: 100

#5046. Луна

統計

Пусть $S$ — сфера радиуса 1 с центром в $(0, 0, 0)$. Пусть $a_0, a_1, \dots, a_n$ — $n + 1$ точка на поверхности $S$. Положения точек $a_1, \dots, a_n$ фиксированы, а положение $a_0$ является равномерно случайной точкой на поверхности $S$. Пусть $f$ равно 1, если существует полусфера $S$, содержащая точки $a_0, \dots, a_n$ (возможно, на границе), и 0 в противном случае. Вычислите математическое ожидание $f$.

Входные данные

Первая строка содержит целое число $n$, обозначающее количество точек ($0 \le n \le 100000$).

$i$-я строка из следующих $n$ строк содержит три целых числа $x, y, z$, обозначающих точку $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)$ ($-1000000 \le x, y, z \le 1000000$, $x^2 + y^2 + z^2 \neq 0$).

Гарантируется, что точки $a_1, \dots, a_n$ различны.

Выходные данные

Выведите ответ.

Ответ будет считаться верным, если его абсолютная или относительная погрешность не превышает $10^{-6}$.

Примеры

Входные данные 1

3
1 0 0
0 1 0
0 0 1

Выходные данные 1

0.875000000000

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.