Once upon a time, an eagle built a nest on the roof of a tall building. In due time, eggs appeared in the nest. On a sunny day, Niels Bohr was walking on the roof and discovered the nest of eggs. He suddenly said: "Oh! If all the eggs have the same durability, then there exists a non-negative number such that if an egg is dropped from the -th floor, it will not break (and of course, this holds for all floors below the -th as well), but if it is dropped from the E + 1-st floor, the egg will break (and this is true for every floor above the -th as well)." Now, Professor Bohr is planning a series of experiments to investigate the strength of the eggs. The goal of the experiments is to determine the value of . It is clear that can be found by dropping a single egg sequentially from the lowest floor upwards. However, there are other strategies that allow to be determined with fewer tosses. Your task is to compute the minimum number of egg drops required to guarantee determining in the worst-case scenario, using the given number of eggs and floors. Note that eggs that are dropped without breaking may be reused in subsequent experiments.
Floors are numbered with positive integers starting from . If an egg breaks when dropped from the first floor, should be considered . If an egg does not break even when dropped from the top floor, consider that is equal to the number of floors in the building.
The input consists of several (up to ) test cases, each on a separate line. Each test case contains two positive integers separated by a space: the number of eggs and the number of floors. Both numbers are positive and do not exceed . The input ends with a line containing two zeros separated by a space. This line should not be processed.
For each test case, output a separate line with the minimum number of egg drops that Niels Bohr must make, even in the worst case.
Example 1