#P6003. [USACO20JAN] Loan Repayment S
[USACO20JAN] Loan Repayment S
Description
Farmer John owes Bessie gallons of milk (). He must give the milk to Bessie within days. However, he does not want to hand over the milk too early. On the other hand, he has to make progress on repaying the debt, so he must give Bessie at least gallons of milk every day ().
Here is how Farmer John decides to repay Bessie. First, he chooses a positive integer . Then, every day he repeats the following process:
- Suppose Farmer John has already given Bessie gallons. Compute . Let this number be .
- If is less than , set to .
- Give Bessie gallons of milk.
Find the maximum value of such that Farmer John can give Bessie at least gallons of milk after days by following the process above ().
Input Format
The input contains only one line with three space-separated positive integers , satisfying .
Output Format
Output the largest positive integer such that, following the process above, Farmer John will give Bessie at least gallons of milk.
10 3 3
2
Hint
Sample Explanation
In this test case, when , Farmer John gives Bessie gallons on the first day, and then gives gallons on each of the next two days.
Subtasks
- Test points satisfy .
- Test points have no additional constraints.
Translated by ChatGPT 5
京公网安备 11011102002149号