SP6562 PRUBALL - Esferas
Description
**Balls**
The classic _Two Glass Balls_ brain-teaser is often posed as: "Given two identical glass spheres, you would like to determine the lowest floor in a 100-story building from which they will break when dropped. Assume the spheres are undamaged when dropped below this point. What is the strategy that will minimize the worst-case scenario for number of drops?" Suppose that we had only one ball. We'd have to drop from each floor from 1 to 100 in sequence, requiring 100 drops in the worst case. Now consider the case where we have two balls. Suppose we drop the first ball from floor **_n_**. If it breaks we're in the case where we have one ball remaining and we need to drop from floors 1 to **_n_**-1 in sequence, yielding **_n_** drops in the worst case (the first ball is dropped once, the second at most **_n_**-1 times). However, if it does not break when dropped from floor **_n_**, we have reduced the problem to dropping from floors **_n_**+1 to 100. In either case we must keep in mind that we've already used one drop. So the minimum number of drops, in the worst case, is the minimum over all **_n_**. You will write a program to determine the minimum number of drops required, in the worst case, given **_B_** balls and an **_M_**-story building.
**Input**
The first line of input contains a single integer **_P_**, (1 _P_ _B_, (1 _B_ _M_, (1 _M_
**Output**
For each data set, generate one line of output with the following values: The data set number as a decimal integer, a space, and the minimum number of drops needed for the corresponding values of **_B_** and **_M_**.
Input Format
N/A
Output Format
N/A