Skip to main content
LIVE CONTEST: ALGOR Contest: Round #4 (Special Challenge) is live now!

~/algor $ cat problems/sonlar-katta-son-qoldigi

Remainder of a big number

Easy 1000 ms 128 MB 20%
Share

You are given positive integers $N$ and $m$. Find the remainder $N \bmod m$ of dividing $N$ by $m$.

The digits of a big number and the remainder of dividing it by the given number

Input

One line with two positive integers: $N$ and $m$. $N$ has no leading zeros.

Output

One integer — $N \bmod m$.

Note

The number of digits of $N$ is from $1$ to $10^{5}$
$1 \le m \le 10^{9}$

Examples

Input #1
123456789012345678901234567890 97
Output #1
52
Input #2
1000 7
Output #2
6

Sign in to submit a solution

Signing up is free and takes a minute.