Limits 1s, 512 MB

You are given two integers nn and mm. You have to subtract mm from nn until nn becomes less than or equal to mm. See the procedure below.

while (n > m) {
    n = n - m;
}

Input

The only line in the input contains nn and mm (1n,m10181 ≤ n, m ≤ 10^{18}).

Output

Print nn after the end of subtraction.

Samples

InputOutput
2 1
1
InputOutput
100 10
10

Submit

Login to submit.

Statistics

67% Solution Ratio
shojib_muEarliest, Jul '19
shojib_muFastest, 0.0s
foysolLightest, 0 B
Nusab19Shortest, 28B
Toph uses cookies. By continuing you agree to our Cookie Policy.