Happy Camper
As Happy Camper Harry pulls into his favorite campground with his family, he notices the sign: 'Campground occupancy is limited to 5 days within any consecutive 8-day period.' Harry is just starting a 20-day vacation. What is the maximum number of days he can occupy a campsite during his vacation?
We state the problem in more general terms. Suppose that l, p, v (1 < l < p < v) are integers. Campground occupancy is limited to l days within any consecutive p-day period. Happy Camper Harry is just starting a v-day vacation. What is the maximum number of days he can occupy a campsite during his vacation?
Input
Contains multiple test cases. For each test case, there will be one line of data, containing values of l, p and v, in that order. All integers can be represented by signed 32-bit integers. End of data will be signaled by a line containing three zeros, which will not be processed.
Output
For each test case print one line. It will display the case number and the number of days Happy Camper Harry can occupy a campsite during his vacation. The format is illustrated by the sample output.