CF760B Frodo and pillows
Description
$ n $ hobbits are planning to spend the night at Frodo's house. Frodo has $ n $ beds standing in a row and $ m $ pillows ( $ n
Input Format
The only line contain three integers $ n $ , $ m $ and $ k $ ( $ 1
Output Format
Print single integer — the maximum number of pillows Frodo can have so that no one is hurt.
Explanation/Hint
In the first example Frodo can have at most two pillows. In this case, he can give two pillows to the hobbit on the first bed, and one pillow to each of the hobbits on the third and the fourth beds.
In the second example Frodo can take at most four pillows, giving three pillows to each of the others.
In the third example Frodo can take three pillows, giving two pillows to the hobbit in the middle and one pillow to the hobbit on the third bed.