Back
Close
  • 369

Statement

 Goal

A building has N floors. One of the floors is the highest floor an egg can be dropped from without breaking.
If an egg is dropped from above that floor, it will break. If it is dropped from that floor or below, it will be completely undamaged and you can drop the egg again.

You are given two identical eggs, find the minimal number of drops it will take in the worst case to find out the highest floor from which an egg will not break.
Input
An integer N for the number of floors.
Output
The minimal number of drops in the worst case.
Constraints
2 ≤ N ≤ 1000
Example
Input
100
Output
14

A higher resolution is required to access the IDE