each day, with the game starting on day .
is playing a mobile game where the goal is to spread a disease across the world. At any point in time, he may infect a healthy person with the pathogen, creating a patient zero. This pathogen spreads very quickly. Specifically, the number of infected people increases by a factor ofpeople over a course of days. In other words, there must be exactly infected people on day . Help him find the minimum number of patient zeros he would have to create to complete his mission.
is trying to complete a very delicate mission in which he has to infect exactlyConstraints
For all subtasks:
Subtask 1 [20%]
Subtask 2 [20%]
Subtask 3 [60%]
No additional constraints.
Input Specification
The only line of input will have , , and , separated by spaces.
Output Specification
Output the required answer, the minimum number of patient zeros
would have to create.Sample Input 1
8 2 1
Sample Output 1
4
Sample Input 2
9 3 2
Sample Output 2
1
Sample Input 3
10 7 10
Sample Output 3
4
Explanation for Sample Outputs
In the first case, the optimal solution is to infect people on day .
In the second case, . On day there will be people infected. And on day there will be , as required.
should infect just one person on dayIn the third case, , infect one person, then infect more on day .
should wait until day
Comments