{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eOnce upon a time an Eagle made a nest on the roof of a very large building. Time went by and some eggs appeared in the nest. There was a sunny day, and Niels Bohr was walking on the roof. He suddenly said: “Oops! All eggs surely have the same solidity, thus there is such non-negative number \u003ci\u003eE\u003c/i\u003e that if one drops an egg from the floor number \u003ci\u003eE\u003c/i\u003e, it will not be broken (and so for all the floors below the \u003ci\u003eE\u003c/i\u003e-th), but if one drops it from the floor number \u003ci\u003eE\u003c/i\u003e+1, the egg will be broken (and the same for every floor higher, than the \u003ci\u003eE\u003c/i\u003e-th).” Now Professor Bohr is going to organize a series of experiments (i.e. drops). The goal of the experiments is to determine the constant \u003ci\u003eE\u003c/i\u003e. It is evident that number \u003ci\u003eE\u003c/i\u003e may be found by dropping eggs sequentially floor by floor from the lowest one. But there are other strategies to find \u003ci\u003eE\u003c/i\u003e for sure with much less amount of experiments. You are to find the least number of eggs droppings, which is sufficient to find number \u003ci\u003eE\u003c/i\u003e for sure, even in the worst case. Note that dropped eggs that are not broken can be used again in following experiments.\u003c/div\u003e\u003c/div\u003e\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eThe floors are numbered with positive integers starting from 1. If an egg has been broken being dropped from the first floor, you should consider that \u003ci\u003eE\u003c/i\u003e is equal to zero. If an egg hasn’t been broken even being dropped from the highest floor, consider that \u003ci\u003eE\u003c/i\u003e is also determined and equal to the total number of floors.\u003c/div\u003e\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eInput contains multiple (up to 1000) test cases. Each line is a test case. Each test case consists of two numbers separated with a space: the number of eggs, and the number of floors. Both numbers are positive and do not exceed 1000. Tests will end with the line containing two zeroes.\u003c/div\u003e\u003c/div\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eFor each test case output in a separate line the minimal number of experiments, which Niels Bohr will have to make even in the worst case.\u003c/div\u003e\u003c/div\u003e"}},{"title":"Sample","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e1 10\r\n2 5\r\n0 0\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e10\r\n3\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}