The Egg Drop
You have E identical eggs and an F-floor building. An egg breaks if dropped from at or above some unknown critical floor. Print the minimum number of drops that GUARANTEES finding the critical floor in the worst case.
Input: one line with two integers E and F.
Output: the minimum worst-case number of drops.
Constraints:
- 1 ≤ E ≤ 100
- 1 ≤ F ≤ 109
Sample Tests
Input 1
2 10
Output 1
4
Input 2
1 5
Output 2
5
Discussion (opens after you solve — no spoilers before)
No comments yet.