Snacks
Time limit1sMemory limit256 MB
Compute K times N minus M, or zero when the money on hand covers the total snack price.
- Level
Easy1 of 10
- Topics
- Math
- Solved
- No attempts yet
Problem
Dongsu wants to buy snacks at a bakery. When his own money is not enough, he gets the difference from his parents. One snack costs won, he wants snacks, and he currently holds won.
The snacks cost won in total. If that total is larger than , he has to get the difference won from his parents, and if is at least the total, he gets nothing. For example, buying 4 snacks at 30 won each while holding 100 won needs 20 won, and buying 6 snacks at 20 won each while holding 120 won needs nothing.
Given , , and , find how much money Dongsu has to get from his parents.
Input
The first line contains the price of one snack , the number of snacks , and the money Dongsu holds , separated by spaces. All three are integers with and .
Output
Print on the first line the amount Dongsu has to get from his parents. Print 0 when he needs nothing.