Math and Watermelons

First Step Contest
Limits 1s, 512 MB

Your friend has MM watermelons. He doesn't want to share them with anyone, but let's imagine he would.

He needs to distribute them equally among KK people. Given he shares them whole and gives them as many as possible, print how many watermelons would remain after giving every individual an equal number of watermelons.

You can assume that there will be more watermelons than the number of people.

Input

The input will contain two integers: MM (K<M<1000000K < M < 1000000) and KK (0<K<1000 < K < 100).

Output

Print the number of remaining watermelons.

Sample

InputOutput
10 3
1

Submit

Login to submit.

Statistics

99% Solution Ratio
raselrokyEarliest, Nov '18
raselrokyFastest, 0.0s
karima.jamanLightest, 0 B
kimiyukiShortest, 14B
Toph uses cookies. By continuing you agree to our Cookie Policy.