#PU991. USACO 2020 January Contest, Silver — Problem 2. Loan Repayment
USACO 2020 January Contest, Silver — Problem 2. Loan Repayment
USACO 2020 January Contest, Silver — Problem 2. 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 .
输出格式
(见题面原文)
数据范围
Test cases 2-4 satisfy Test cases 5-11 satisfy no additional constraints.
样例
样例 1
10 3 3
2
For the first test case, when $X=2$ Farmer John gives Bessie $5$ gallons on the
first day and $M=3$ gallons on each of the next two days.
提示
data types (e.g., a "long long" in C/C++). Problem credits: Nick Wu