402903: GYM100942 D Camelogistics

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

D. Camelogistics time limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

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.

Input

A single line contains space-separated integers L, N, K (1 ≤ L, N, K ≤ 109)

Output

Output a single number — the highest possible number of apples delivered to the plant.

ExamplesInput
5 30 10
Output
11
Input
1000 2999 1001
Output
533
Input
5 4 10
Output
0

加入题单

算法标签: