pieces, whose dimensions don't matter.
pieces of paper, he can cut the starting piece in
, then stack the
pieces together and cut them to obtain
pieces. The catch is, doesn't have very good scissors, so he can cut through at most
sheets of paper at a time.
To save time, he would like for you to find out the minimum number of cuts required to obtain the pieces.
Constraints
Subtask 1 [60%]
Subtask 2 [40%]
Input Specification
The only line of input contains and
, separated by a space.
Output Specification
One integer, the minimum number of cuts required to obtain the pieces.
Sample Input 1
4 2
Sample Output 1
2
Explanation for Sample Output 1
See problem description above.
Sample Input 2
100000 1
Sample Output 2
99999
Explanation for Sample Output 2
Since times for
pieces of paper.
Sample Input 3
100 7
Sample Output 3
17
Comments
For the last two cases, output has to be long to prevent int overflow.
True origami does not use scissors. You are not a true origami.
Then what do you use to cut the wood to make the paper if origami is just folding
teach me how to be an origami