Egg Drop
hard
1. You are given two integers N and K. N represents the number of eggs and K represents the number of floors in a building. 2. You have to find the minimum number of attempts you need in order to find the critical floor in the worst case while using the best strategy. 3. The critical floor is defined as the lowest floor from which you drop an egg and it doesn't break. 4. There are certain which you have to follow - a. All eggs are identical. b. An egg that survives a fall can be used again. c. A broken egg can't be used again. d. If the egg doesn't break at a certain floor, it will not break at any floor below. e. If the egg breaks at a certain floor, it will break at any floor above.
Constraints
1 <= N <= 100 1 <= k <= 50
Format
Input
Two integers N and K
Output
Check the sample output and question video.
Example
Sample Input
3
10
Sample Output
4