~/algor $ cat contests/round-8/I
I. Parking fee
Problem I
ICPC rules
1000 ms
64 MB
At a car park, the first minutes are free. After that, soums are charged for every started hour: for example, a car that stayed minutes pays soums, and one that stayed minutes pays soums. But the fee for a day never exceeds soums: if the computed amount is larger than , soums are paid. A car stayed minutes. Find the fee.
Input
One line with three positive integers: , and .
Output
One integer — the fee.
Note
Examples
Input #1
150 3000 10000
Output #1
6000
Input #2
1440 3000 20000
Output #2
20000