Problem F
Modular Arithmetic
Input
There are several test cases. Each test case begins with a
line containing two integers
Then follow
Input is terminated by a case where
Output
For each operation in each test case, output the result of
performing the indicated operation modulo
Sample Input 1 | Sample Output 1 |
---|---|
1000 3 1 / 999 1 / 998 578 * 178 13 4 7 / 9 9 * 3 0 - 9 10 + 10 0 0 |
999 -1 884 8 1 4 7 |