It is a C++ code which tells you the minimum number of attempts to know the crtical floor out of k floors which will cause the eggs to break on landing. You are given n eggs to use.
This is a C++ code which is the implementation of the famous egg-dropping problem. It tells you the minimum number of attempts to know that which floors in a k-floored building are safe to drop the eggs from, and which will cause the eggs to break when dropped from there. The user needs to input the number of floors(k) and the number of eggs(n) to be used to get the result.
There are a few considerations. They are:-
i) All eggs are identical.
ii) An egg that survives a drop can be used again.
iii) If an egg breaks when dropped from a certain floor, then it would surely break if dropped from a higher floor.
iv) If an egg does'nt break on a drop, then it would survive a drop from a lower floor