Esquirols i nous


Submit solution

Points: 10
Time limit: 5.0s
Memory limit: 256M

Author:
Problem type
Allowed languages
C#, Go, Java

\(E\) esquirols han trobat \(N\) nous i han decidit repartir-se-les equitativament (tots els esquirols agafaran la mateixa quantitat de nous). Esbrina quantes nous sobraran després de que cada esquirol prengui les seves.

Input Format

Dos enters positius \(E\) i \(N\). Separats per un espai o un salt de línia.

Constraints

  • \(E <= 10000\)
  • \(N <= 10000\)

Output Format

-

Test Case 1

Input
2 10
Output
0
Explanation

Cada esquirol pren 5 nous, i no en sobra cap.

Test Case 2

Input
3 14
Output
2
Explanation

Els 3 esquirols prenen cadascú 4 nous, i en sobren 2.

Test Case 3

Input
7 48
Output
6
Explanation

Cadascún dels 7 esquirols pren 6 nous, en sobren 6.

Test Case 4

Input
4564 98743
Output
2899

Test Case 5

Input
23423 239842
Output
5612

Authorship: Gerard Falcó

CC BY-NC-SA 4.0