The monkey and the coconuts
To break a coconut, monkey is often used on the roof of N-storey building and throw down coconuts. Once a cute monkey, who are tired of climbing on the roof and decided to find the lowest floor, the drop from which the coconut is broken. The monkey can climb to any floor from 1 to N-th (the roof is (N +1)-th floor) and throw a coconut in the window. If the coconut does not break if dropped, a monkey can use it to experiment again. All in all monkeys for experiments prepared K coconuts. The monkey has to figure out the number of the desired floor, using no more than K coconuts. Also, the monkey wants to find a floor for the minimum number of throws, so it can carry only one coconut, and for every shot she has to go down to the ground prepared for the experiments of coconut or previously abandoned, but not broken coconut.
Write a program that will make a plan of experiments, minimizing the number of shots in the worst case. The plan should take into account that the required floor can be any floor from 1 to N, and it may be that coconut is broken only when falling from the roof.
Input
The first line of the input file contains two integers, separated by a space - the number of floors N (1 ≤ N ≤ 1000000) and the number of coconuts K (1 ≤ K ≤ 1000).
Output
The first line of the output file display one integer - the minimum number of tests in the worst case.