

Time Limit: 2 sec / Memory Limit: 1024 MB
配点 : 点
問題文
正整数 に対して、 を 個つなげた整数を とします。
より厳密には、 を文字列とみなしたものを 個連結し、
それを再度整数とみなしたものを とします。
例えば、, です。
を で割った余りを求めてください。
制約
- は整数
入力
入力は以下の形式で標準入力から与えられる。
出力
を で割った余りを出力せよ。
入力例 1Copy
5
出力例 1Copy
55555
を で割った余りは です。
入力例 2Copy
9
出力例 2Copy
1755646
を で割った余りは です。
入力例 3Copy
10000000000
出力例 3Copy
468086693
入力が bit 整数型に収まらない可能性があることに注意してください。
Score : points
Problem Statement
For a positive integer , let be the integer formed by concatenating exactly times.
More precisely, consider as a string, concatenate copies of it, and treat the result as an integer to get .
For example, and .
Find the remainder when is divided by .
Constraints
- is an integer.
Input
The input is given from Standard Input in the following format:
Output
Print the remainder when is divided by .
Sample Input 1Copy
5
Sample Output 1Copy
55555
The remainder when is divided by is .
Sample Input 2Copy
9
Sample Output 2Copy
1755646
The remainder when is divided by is .
Sample Input 3Copy
10000000000
Sample Output 3Copy
468086693
Note that the input may not fit into a -bit integer type.