Dereck is in chemistry class!
For Dereck's first lab in chemistry, he is told to create a solution. Little does he know, he is actually creating hydrogen cyanide, a deadly (colourless) poison! Unfortunately for him, after creating the solution, he wasn't keeping track of which beaker it was in, and the beaker got mixed with the
Luckily, his teacher, Ms. Zeiler, happened to have a substance that can detect hydrogen cyanide lying around. All he needs to do is to drip one drop of the substance into the beaker with the hydrogen cyanide for it to change colour. Not wanting to contaminate the distilled water beakers with this substance, he will take
In each clean cup, he will pour some amount (possibly none, or infinitesimally small amount) of each beaker's contents into it. Afterwards, he will drip one drop of the substance into each cup to determine if there was hydrogen cyanide. The substance will change colour even if there is only an infinitesimally small amount of hydrogen cyanide in the cup. Afterwards, he will clean the cups completely and repeat the process. This entire process takes exactly
Class ends in
Of course, Dereck is smart enough to be able to use the results from the previous minutes in the current minute.
Input Specification
The first line will contain the integer
The second line will contain the integer
Output Specification
Output the minimum value of
It is guaranteed that
Constraints
Subtask 1 [35%]
Subtask 2 [65%]
No additional constraints.
Sample Input 1
3
1
Sample Output 1
2
Explanation for Sample 1
One possible way Dereck can use to determine the beaker is:
- We can drip a drop of the contents of beaker
into cup . - We can drip a drop of the contents of beaker
into cups and .
If only cup
Sample Input 2
4
1
Sample Output 2
2
Sample Input 3
15
2
Sample Output 3
2
Sample Input 4
10000
2
Sample Output 4
7
Comments