AtCoder Regular Contest 111
A
Simple Math 2
AtCoder
⌀ 1146
原题
←B →
翻译中…

Problem Statement

翻译中…

Given positive integers $N$ and $M$, find the remainder when $\lfloor \frac{10^N}{M} \rfloor$ is divided by $M$.

翻译中…

What is $\lfloor x \rfloor$? $\lfloor x \rfloor$ denotes the greatest integer not exceeding $x$. For example: $\lfloor 2.5 \rfloor = 2$ $\lfloor 3 \rfloor = 3$ $\lfloor 9.9999999 \rfloor = 9$ $\lfloor \frac{100}{3} \rfloor = \lfloor 33.33... \rfloor = 33$

翻译中…

Constraints

翻译中…
  • $1 \leq N \leq 10^{18}$
  • $1 \leq M \leq 10000$
翻译中…

Input

翻译中…

Input is given from Standard Input in the following format:

翻译中…

N M

翻译中…

Output

翻译中…

Print the answer.

翻译中…

样例

Input #1
1 2
Output #1
1
We have $\lfloor \frac{10^1}{2} \rfloor = 5$, so we should print the remainder when $5$ is divided by $2$, that is, $1$.
Input #2
2 7
Output #2
0
Input #3
1000000000000000000 9997
Output #3
9015
题目信息
题号
arc111_a
时间限制
2 s
内存限制
1024 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。