You are given a building with
kidentical bottles. Each bottle can be dropped from any floor of the building and will break if dropped from or above a certain floor.
Your task is to determine the minimum number of attempts required to find the lowest floor from which the bottle will break when dropped, using the given bottles.
The only line of the input contains two integers
n≤ 500) and
k≤ 30), representing the number of floors in the building and the number of bottles, respectively.
Output a single integer, representing the minimum number of attempts required to find the lowest breaking floor, using the given number of bottles.
Time limit: 5 seconds
Memory limit: 512 MB
Output limit: 1 MB