I. Moon

Codeforces
IDCF10247I
Time2000ms
Memory256MB
Difficulty
English · Original
Formal · Original
Let $S$ be a sphere with radius $1$ and center $(0, 0, 0)$. Let $a_0, a_1, \\dots, a_n$ be $n + 1$ points on the surface of $S$. The positions of $a_1, \\dots, a_n$ are fixed while the position of $a_0$ is a uniform random point on the surface of $S$. Let $f$ be $1$ if there exists a hemisphere of $S$ that contains $a_0, \\dots, a_n$(possibly on the border) and $0$ otherwise. Calculate the expected value of $f$. The first line contains an integer $n$ denoting the number of points ($0 <= n <= 100000$). The $i$-th line of the next $n$ lines contains three integers $x, y, z$ denoting the point $a_i = (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)))$ ($-1000000 <= x, y, z <= 1000000, x^2 + y^2 + z^2 eq.not 0$). It is guaranteed that $a_1, \\dots, a_n$ are distinct. Output the answer. The answer will be considered correct if its absolute or relative error doesn't exceed $10^(-6)$. ## Input The first line contains an integer $n$ denoting the number of points ($0 <= n <= 100000$).The $i$-th line of the next $n$ lines contains three integers $x, y, z$ denoting the point $a_i = (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)))$ ($-1000000 <= x, y, z <= 1000000, x^2 + y^2 + z^2 eq.not 0$).It is guaranteed that $a_1, \\dots, a_n$ are distinct. ## Output Output the answer.The answer will be considered correct if its absolute or relative error doesn't exceed $10^(-6)$. [samples]
**Definitions** Let $ S = \{ \mathbf{x} \in \mathbb{R}^3 : \|\mathbf{x}\| = 1 \} $ be the unit sphere centered at the origin. Let $ \mathbf{a}_1, \dots, \mathbf{a}_n \in S $ be fixed distinct points on $ S $. Let $ \mathbf{a}_0 $ be a random point uniformly distributed on $ S $. Define the indicator function: $$ f = \begin{cases} 1 & \text{if } \exists \text{ a closed hemisphere } H \subseteq \mathbb{R}^3 \text{ such that } \{\mathbf{a}_0, \dots, \mathbf{a}_n\} \subseteq H, \\ 0 & \text{otherwise}. \end{cases} $$ **Constraints** 1. $ n \in \mathbb{Z} $, $ 0 \leq n \leq 100000 $ 2. For each $ i \in \{1, \dots, n\} $, $ \mathbf{a}_i = \frac{(x_i, y_i, z_i)}{\| (x_i, y_i, z_i) \|} $ for integers $ x_i, y_i, z_i \in [-10^6, 10^6] $, with $ x_i^2 + y_i^2 + z_i^2 \neq 0 $. 3. All $ \mathbf{a}_1, \dots, \mathbf{a}_n $ are distinct. **Objective** Compute $ \mathbb{E}[f] $, the probability that $ \mathbf{a}_0, \mathbf{a}_1, \dots, \mathbf{a}_n $ lie together in some closed hemisphere.
API Response (JSON)
{
  "problem": {
    "name": "I. Moon",
    "description": {
      "content": "Let $S$ be a sphere with radius $1$ and center $(0, 0, 0)$. Let $a_0, a_1, \\\\dots, a_n$ be $n + 1$ points on the surface of $S$. The positions of $a_1, \\\\dots, a_n$ are fixed while the position of $a_",
      "description_type": "Markdown"
    },
    "platform": "Codeforces",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "CF10247I"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "Let $S$ be a sphere with radius $1$ and center $(0, 0, 0)$. Let $a_0, a_1, \\\\dots, a_n$ be $n + 1$ points on the surface of $S$. The positions of $a_1, \\\\dots, a_n$ are fixed while the position of $a_...",
      "is_translate": false,
      "language": "English"
    },
    {
      "statement_type": "Markdown",
      "content": "**Definitions**  \nLet $ S = \\{ \\mathbf{x} \\in \\mathbb{R}^3 : \\|\\mathbf{x}\\| = 1 \\} $ be the unit sphere centered at the origin.  \nLet $ \\mathbf{a}_1, \\dots, \\mathbf{a}_n \\in S $ be fixed distinct poin...",
      "is_translate": false,
      "language": "Formal"
    }
  ]
}
Full JSON Raw Segments