E. Decimal Expansion

Codeforces
IDCF10235E
Time1000ms
Memory256MB
Difficulty
English · Original
Formal · Original
Consider the following constant: $$\varphi = \dfrac{9}{10} \cdot \dfrac{99}{100} \cdot \dfrac{999}{1000} \cdot \dfrac{9999}{10000}\cdot \dots$$ You have to find the $n$-th digit after the decimal separator in the decimal representation of $phi.alt$. The first line of input contains a single integer $t$ ($1 <= t <= 10^5$) which is the number of test cases. The next line contains $t$ integers $n$ ($1 <= n <= 10^(18)$), one for each test case. For each test case, output a single digit which is the answer to that test case. Separate consecutive answers by single spaces. The constant evaluates as $phi.alt = 0. 890010099998999 \\dots$ ## Input The first line of input contains a single integer $t$ ($1 <= t <= 10^5$) which is the number of test cases.The next line contains $t$ integers $n$ ($1 <= n <= 10^(18)$), one for each test case. ## Output For each test case, output a single digit which is the answer to that test case. Separate consecutive answers by single spaces. [samples] ## Note The constant evaluates as $phi.alt = 0. 890010099998999 \\dots$
**Definitions** Let $\varphi = \prod_{k=1}^{\infty} \left(1 - 10^{-k}\right)$. **Constraints** 1. $1 \le t \le 10^5$ 2. For each test case, $1 \le n \le 10^{18}$ **Objective** For each test case, find the $n$-th digit after the decimal point in the decimal expansion of $\varphi$.
API Response (JSON)
{
  "problem": {
    "name": "E. Decimal Expansion",
    "description": {
      "content": "Consider the following constant: $$\\varphi = \\dfrac{9}{10} \\cdot \\dfrac{99}{100} \\cdot \\dfrac{999}{1000} \\cdot \\dfrac{9999}{10000}\\cdot \\dots$$ You have to find the $n$-th digit after the decimal sep",
      "description_type": "Markdown"
    },
    "platform": "Codeforces",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "CF10235E"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "Consider the following constant: $$\\varphi = \\dfrac{9}{10} \\cdot \\dfrac{99}{100} \\cdot \\dfrac{999}{1000} \\cdot \\dfrac{9999}{10000}\\cdot \\dots$$\n\nYou have to find the $n$-th digit after the decimal sep...",
      "is_translate": false,
      "language": "English"
    },
    {
      "statement_type": "Markdown",
      "content": "**Definitions**  \nLet $\\varphi = \\prod_{k=1}^{\\infty} \\left(1 - 10^{-k}\\right)$.\n\n**Constraints**  \n1. $1 \\le t \\le 10^5$  \n2. For each test case, $1 \\le n \\le 10^{18}$\n\n**Objective**  \nFor each test ...",
      "is_translate": false,
      "language": "Formal"
    }
  ]
}
Full JSON Raw Segments