402903: GYM100942 D Camelogistics
Description
Logistics is a very difficult thing. Logistics in a desert is an incredible art.
In a vast desert there is a warehouse with N apples. There is a plant which produces apple juice L kilometers away from the apple warehouse. The only way to transport apples is a freight camel parked near the warehouse. This camel has a phenomenal load capacity, but it cannot carry more than K apples. Moreover the camel needs eat one apple each kilometer otherwise there will be no way to carry the next batch. After each kilometer on the way from the warehouse there is an awning where it is possible to leave any amount of apples.
Find out the maximum possible amount of apples that can be delivered to the plant.
InputA single line contains space-separated integers L, N, K (1 ≤ L, N, K ≤ 109)
OutputOutput a single number — the highest possible number of apples delivered to the plant.
ExamplesInput5 30 10Output
11Input
1000 2999 1001Output
533Input
5 4 10Output
0