Epidemiology | 프로그래밍의 벗 PivotOJ
PivotOJ

Epidemiology

시간 제한: 2000ms메모리 제한: 512MB출처: CCC 2020 JuniorBOJ 19603

문제

People who study epidemiology use models to analyze the spread of disease. In this problem, we use a simple model.

When a person has a disease, they infect exactly R other people but only on the very next day. No person is infected more than once. We want to determine when a total of more than P people have had the disease.

This problem was designed before the current coronavirus outbreak, and we acknowledge the distress currently being experienced by many people worldwide because of this and other diseases. We hope that including this problem at this time highlights the important roles that computer science and mathematics play in solving real-world problems.

입력

There are three lines of input. Each line contains one positive integer. The first line contains the value of P. The second line contains N, the number of people who have the disease on Day 0. The third line contains the value of R. Assume that P ≤ 107 and N ≤ P and R ≤ 10.

출력

Output the number of the first day on which the total number of people who have had the disease is greater than P.

예제

예제 1

입력
750
1
5
출력
4

예제 2

입력
10
2
1
출력
5
코드를 제출하려면 로그인하세요.