LCC '25 Contest 1 J1 - Bob the Ghost

View as PDF

Submit solution


Points: 3
Time limit: 0.5s
Memory limit: 64M

Author:
Problem type

Bob the ghost has recently been going out to spook trick-or-treaters! Today, Bob has decided to target one poor victim with N candies. Bob spooks the victim a times, and each time the target is spooked, they lose b candies. How many candies does Bob's victim have left by the end of the day?

Input Specification

There will be 1 line of input containing three space-separated integers N, a, b.

Output Specification

Output one integer, indicating the number of candies that the victim keeps.

Constraints

1 \leq N \leq 10^6

0 \leq a \leq 10^3

0 \leq b \leq 10^3

N \geq ab

Sample Input

15 3 4

Sample Output

3

Sample Explanation

Bob's victim starts with 15 candies, and loses 3 \times 4 candies, leaving 3 candies left over.


Comments

There are no comments at the moment.