floors, and you have two identical prototypes.
There is an unknown floor f (0 ≤ f ≤ floors): a prototype dropped from floor f or lower stays intact, while one dropped from any floor above f breaks. A broken prototype is gone for good, but an intact one can be dropped again as many times as you like.
Each move, you drop one intact prototype from any floor between 1 and floors. Return the smallest number of drops that lets you determine f **for certain**, no matter how the drops turn out.floors=3 → 2
Drop the first prototype from floor 2. If it breaks, drop the second one from floor 1 and you know the answer. If it survives, drop it again from floor 3. Two drops are always enough.
floors=10 → 4
Drop the first prototype from floors 4, 7, 9 and 10 in turn. Once it breaks, walk the second one up through the floors in between, one at a time. The worst case is 4 drops, and 3 drops can never cover more than 6 floors.
floors=1 → 1
floors ≤ 1000floors=3
2
Run checks the first 3 tests in your browser. Submit checks all 49 tests on the server, hidden ones included.