Camping
Time limit1sMemory limit128 MB
Given limits L, P, V, find the most days out of V that satisfy using at most L days in any window of P consecutive days.
Problem
Mountaineer Kim Kangsan went camping with his family. However, the campsite had the following warning posted:
This campsite may only be used for 10 days out of any 20 consecutive days.
Kangsan has just started a 28-day vacation. During this vacation, at most how many days can Kangsan use the campsite?
Kangsan wants to solve a more general version of the problem. The campsite may be used for only days out of every consecutive days, and Kangsan's vacation lasts days. Find the maximum number of days Kangsan can use the campsite (where ).
Input
The input consists of several test cases. Each test case is given on a single line containing three integers , , and in that order. All integers fit within the int range. The last line of the input contains 0 0 0, which must not be processed.
Output
For each test case, print the maximum number of days Kangsan can use the campsite, one per line, in the format Case x: y, where x is the test case number starting from 1 and y is the answer.