Loan Repayment
문제
Farmer John owes Bessie gallons of milk (). He has to give her the milk within days. However, he doesn't want to give the milk away too quickly. On the other hand, he has to make forward progress on the loan, so he must give Bessie at least gallons of milk each day ().
Here is how Farmer John decides to pay back Bessie. He first picks a positive integer . He then repeats the following procedure every day:
- Assuming that Farmer John has already given Bessie gallons, compute rounded down. Call this number .
- If is less than , set to .
- Give Bessie gallons of milk.
Determine the largest such that if Farmer John follows the above procedure, Farmer John gives Bessie at least gallons of milk after days ().
입력
The only line of input contains three space-separated positive integers , , and satisfying .
출력
Output the largest positive integer such that Farmer John will give Bessie at least gallons using the above procedure.
힌트
For the first test case, when Farmer John gives Bessie gallons on the first day and gallons on each of the next two days.
Note that the large size of integers involved in this problem may require the use of 64-bit integer data types (e.g., a "long long" in C/C++).
예제
예제 1
10 3 3
2