AtCoder Beginner Contest 087
翻译中…
Problem Statement
翻译中…
You went shopping to buy cakes and donuts with $X$ yen (the currency of Japan).
翻译中…
First, you bought one cake for $A$ yen at a cake shop. Then, you bought as many donuts as possible for $B$ yen each, at a donut shop.
翻译中…
How much do you have left after shopping?
翻译中…
Constraints
翻译中…
$1 \leq A, B \leq 1$$000$$A + B \leq X \leq 10$$000$$X$,$A$and$B$are integers.
翻译中…
Input
翻译中…
Input is given from Standard Input in the following format:
翻译中…
X
A
B
翻译中…
Output
翻译中…
Print the amount you have left after shopping.
翻译中…
样例
Input #1
1234
150
100
Output #1
84
You have $1234 - 150 = 1084$ yen left after buying a cake. With this amount, you can buy $10$ donuts, after which you have $84$ yen left.
Input #2
1000
108
108
Output #2
28
Input #3
579
123
456
Output #3
0
Input #4
7477
549
593
Output #4
405
题目信息
题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。