ENG  RUSTimus Online Judge
Online Judge
Online contests
About Online Judge
Frequently asked questions
Site news
Problem set
Submit solution
Judge status
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests

Bulgarian Contest September 2001

About     Problems     Submit solution     Judge status     Standings
Contest is over

F. Jeep

Time limit: 0.5 second
Memory limit: 64 MB
Our jeep is in the desert and must reach a point which is N kilometres away from it. The terrain is tough, the car is old, and it seems like the fuel flows out, and because of this on every kilometre travelled, one litre of fuel is spent. But the jeep has fuel-cans and fuel tank with total capacity of M < N litres. On other hand, at the beginning of the road there is unlimited amount of fuel, and everywhere in the desert there are empty cisterns, in which the jeep, passing near them, can leave unlimited amount of fuel.
Write a program which calculates the minimum amount of fuel in litres which is needed to reach the destination point.


Two integers N and M are written on the only line of input. It is known that 5MN > 0. (N < 32000).


The result (the minimum liters of fuel, eventually rounded up), must be written on the only line of output.


1000 500
Problem Source: Bulgarian National Olympiad Day #2
To submit the solution for this problem go to the Problem set: 1113. Jeep