QOJ.ac

QOJ

実行時間制限: 1.0 s メモリ制限: 256 MB 満点: 100 ハック可能 ✓

#18326. Kaka Number

統計

Given a non-negative integer $x$, consider all integers in the interval $[0, 10^x - 1]$. Question: When these integers are written in decimal notation, how many times does the digit '1' appear in total? The answer should be taken modulo $998244353$.

(Hint: When you have no ideas, you might find some patterns or insights by generating a table for small ranges of data.)

Input

A single integer $x$ ($0 \le x \le 1000000$).

Output

Output a single integer representing the answer modulo $998244353$.

Examples

Input 1

2

Output 1

20

Input 2

0

Output 2

0

Note

When $x = 2$, the interval is $[0, 99]$. To write out these one hundred numbers, we need to write the digit '1' a total of 20 times, so the answer is 20.

When $x = 0$, the interval contains only the integer 0, and the answer is 0.

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.