#466
Unrated
Loan Repayment
시간 제한
2s
메모리 제한
1024MB
제출
0
정답
0
맞힌 사람
0
정답 비율
0.0%

문제

Farmer John owes Bessie NN gallons of milk (1N10121\le N\le 10^{12}). He has to give her the milk within KK 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 MM gallons of milk each day (1M10121\le M\le 10^{12}).

Here is how Farmer John decides to pay back Bessie. He first picks a positive integer XX. He then repeats the following procedure every day:

Assuming that Farmer John has already given Bessie GG gallons, compute NGX\frac{N-G}{X} rounded down. Call this number YY.If YY is less than MM, set YY to MM. Give Bessie YY gallons of milk.

Determine the largest XX such that if Farmer John follows the above procedure, Farmer John gives Bessie at least NN gallons of milk after KK days (1K10121\le K\le 10^{12}).

SCORING:

Test cases 2-4 satisfy K105.K\le 10^5.Test cases 5-11 satisfy no additional constraints.

입력

The only line of input contains three space-separated positive integers NN, KK, and MM satisfying KM<NK\cdot M<N.

출력

Output the largest positive integer XX such that Farmer John will give Bessie at least NN gallons using the above procedure.

예제 입력 1

10 3 3

예제 출력 1

2
코드 제출

코드를 제출하려면 로그인이 필요합니다.

로그인
내 제출
제출 내역이 없습니다.
맞은 사람
아직 맞은 사람이 없습니다.
난이도 투표
Unrated0명 투표
로그인 후 AC 받으면 투표할 수 있습니다.
전체 제출
제출 내역이 없습니다.