H. Cube

Codeforces
IDCF10185H
Time1000ms
Memory256MB
Difficulty
English · Original
Formal · Original
In geometry, a cube is a three-dimensional solid object bounded by six square faces, with three meeting at each vertex. The image bellow is an example of a cube. You are given the surface area of a cube, and your task is to find the length of that cube's edge. Can you? The first line contains an integer T (1 ≤ T ≤ 1000), in which T is the number of test cases. Each test case consists of a line containing an integer a (1 ≤ a ≤ 6 × 106), giving the surface area of a cube. For each test case, print a single line containing the length of the given cube's edge. *It is guaranteed that all answers are integer numbers. Do not print any floating-point values.* ## Input The first line contains an integer T (1 ≤ T ≤ 1000), in which T is the number of test cases.Each test case consists of a line containing an integer a (1 ≤ a ≤ 6 × 106), giving the surface area of a cube. ## Output For each test case, print a single line containing the length of the given cube's edge.*It is guaranteed that all answers are integer numbers. Do not print any floating-point values.* [samples]
**Definitions** Let $ n \in \mathbb{Z}_{\geq 0} $ be the starting floor. Let $ a \in \mathbb{Z}_{\geq 0} $ be the number of battles. Let $ p \in [0, 100] $ be the win probability percentage; define $ q = \frac{p}{100} \in [0, 1] $ as the probability of winning a single battle. **Constraints** $ 0 \leq n, a \leq 10^9 $, $ 0 \leq p \leq 100 $. **Objective** Let $ X $ be the random variable denoting the final floor after $ a $ battles. Each win increases floor by 1, each loss decreases floor by 1. Let $ W \sim \text{Binomial}(a, q) $ be the number of wins. Then the number of losses is $ a - W $, and: $$ X = n + W - (a - W) = n + 2W - a $$ The expected final floor is: $$ \mathbb{E}[X] = n + 2\mathbb{E}[W] - a = n + 2aq - a = n + a(2q - 1) $$
API Response (JSON)
{
  "problem": {
    "name": "H. Cube",
    "description": {
      "content": "In geometry, a cube is a three-dimensional solid object bounded by six square faces, with three meeting at each vertex. The image bellow is an example of a cube. You are given the surface area of a c",
      "description_type": "Markdown"
    },
    "platform": "Codeforces",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "CF10185H"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "In geometry, a cube is a three-dimensional solid object bounded by six square faces, with three meeting at each vertex. The image bellow is an example of a cube.\n\nYou are given the surface area of a c...",
      "is_translate": false,
      "language": "English"
    },
    {
      "statement_type": "Markdown",
      "content": "**Definitions**  \nLet $ n \\in \\mathbb{Z}_{\\geq 0} $ be the starting floor.  \nLet $ a \\in \\mathbb{Z}_{\\geq 0} $ be the number of battles.  \nLet $ p \\in [0, 100] $ be the win probability percentage; def...",
      "is_translate": false,
      "language": "Formal"
    }
  ]
}
Full JSON Raw Segments