88888888

AtCoder
IDabc357_d
Time2000ms
Memory256MB
Difficulty
For a positive integer $N$, let $V_N$ be the integer formed by concatenating $N$ exactly $N$ times. More precisely, consider $N$ as a string, concatenate $N$ copies of it, and treat the result as an integer to get $V_N$. For example, $V_3=333$ and $V_{10}=10101010101010101010$. Find the remainder when $V_N$ is divided by $998244353$. ## Constraints * $1 \leq N \leq 10^{18}$ * $N$ is an integer. ## Input The input is given from Standard Input in the following format: $N$ [samples]
Samples
Input #1
5
Output #1
55555

The remainder when $V_5=55555$ is divided by $998244353$ is $55555$.
Input #2
9
Output #2
1755646

The remainder when $V_9=999999999$ is divided by $998244353$ is $1755646$.
Input #3
10000000000
Output #3
468086693

Note that the input may not fit into a $32$\-bit integer type.
API Response (JSON)
{
  "problem": {
    "name": "88888888",
    "description": {
      "content": "For a positive integer $N$, let $V_N$ be the integer formed by concatenating $N$ exactly $N$ times.   More precisely, consider $N$ as a string, concatenate $N$ copies of it, and treat the result as an",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "abc357_d"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "For a positive integer $N$, let $V_N$ be the integer formed by concatenating $N$ exactly $N$ times.  \nMore precisely, consider $N$ as a string, concatenate $N$ copies of it, and treat the result as an...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments