{"trustable":false,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003e Problems in Computer Science are often classified as belonging to a certain class of problems (e.g., NP, Unsolvable, Recursive). In this problem you will be analyzing a property of an algorithm whose classification is not known for all possible inputs.\u003c/p\u003e \n\u003cp\u003e \u0026nbsp;\u003c/p\u003e \n\u003cp\u003e Consider the following algorithm:\u003c/p\u003e \n\u003cpre\u003e\r\n \r\n1. input \u003ci\u003en\u003c/i\u003e\r\n\u003c/pre\u003e \n\u003cp\u003e 2. print \u003ci\u003en\u003c/i\u003e \u003c/p\u003e \n\u003cp\u003e 3. if \u003ci\u003en\u003c/i\u003e \u003d 1 then STOP \u003c/p\u003e \n\u003cp\u003e 4. if \u003ci\u003en\u003c/i\u003e is odd then \u003cimg align\u003d\"MIDDLE\" alt\u003d\"tex2html_wrap_inline44\" height\u003d\"25\" src\u003d\"http://uva.onlinejudge.org/external/1/100img1.gif\" width\u003d\"95\"\u003e \u003c/p\u003e \n\u003cp\u003e 5. else \u003cimg align\u003d\"MIDDLE\" alt\u003d\"tex2html_wrap_inline46\" height\u003d\"27\" src\u003d\"http://uva.onlinejudge.org/external/1/100img2.gif\" width\u003d\"74\"\u003e \u003c/p\u003e \n\u003cp\u003e 6. \u003cspan\u003eGOTO\u003c/span\u003e 2 \u003c/p\u003e \n\u003cp\u003e \u0026nbsp;\u003c/p\u003e \n\u003cp\u003e Given the input 22, the following sequence of numbers will be printed 22 11 34 17 52 26 13 40 20 10 5 16 8 4 2 1\u003c/p\u003e \n\u003cp\u003e It is conjectured that the algorithm above will terminate (when a 1 is printed) for any integral input value. Despite the simplicity of the algorithm, it is unknown whether this conjecture is true. It has been verified, however, for all integers \u003ci\u003en\u003c/i\u003e such that 0 \u0026lt; \u003ci\u003en\u003c/i\u003e \u0026lt; 1,000,000 (and, in fact, for many more numbers than this.)\u003c/p\u003e \n\u003cp\u003e Given an input \u003ci\u003en\u003c/i\u003e, it is possible to determine the number of numbers printed (including the 1). For a given \u003ci\u003en\u003c/i\u003e this is called the \u003cem\u003ecycle-length\u003c/em\u003e of \u003ci\u003en\u003c/i\u003e. In the example above, the cycle length of 22 is 16.\u003c/p\u003e \n\u003cp\u003e For any two numbers \u003ci\u003ei\u003c/i\u003e and \u003ci\u003ej\u003c/i\u003e you are to determine the maximum cycle length over all numbers between \u003cu\u003e \u003ci\u003ei\u003c/i\u003e and \u003ci\u003ej\u003c/i\u003e. \u003c/u\u003e\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003e The input will consist of a series of pairs of integers \u003ci\u003ei\u003c/i\u003e and \u003ci\u003ej\u003c/i\u003e, one pair of integers per line. All integers will be less than 1,000,000 and greater than 0.\u003c/p\u003e \n\u003cp\u003e You should process all pairs of integers and for each pair determine the maximum cycle length over all integers between and including \u003ci\u003ei\u003c/i\u003e and \u003ci\u003ej\u003c/i\u003e.\u003c/p\u003e \n\u003cp\u003e You can assume that no operation overflows a 32-bit integer.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003e For each pair of input integers \u003ci\u003ei\u003c/i\u003e and \u003ci\u003ej\u003c/i\u003e you should output \u003ci\u003ei\u003c/i\u003e, \u003ci\u003ej\u003c/i\u003e, and the maximum cycle length for integers between and including \u003ci\u003ei\u003c/i\u003e and \u003ci\u003ej\u003c/i\u003e. These three numbers should be separated by at least one space with all three numbers on one line and with one line of output for each line of input. The integers \u003ci\u003ei\u003c/i\u003e and \u003ci\u003ej\u003c/i\u003e must appear in the output in the same order in which they appeared in the input and should be followed by the maximum cycle length (on the same line).\u003c/p\u003e"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cpre\u003e\r\n1 10\r\n100 200\r\n201 210\r\n900 1000\r\n\u003c/pre\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cpre\u003e\r\n1 10 20\r\n100 200 125\r\n201 210 89\r\n900 1000 174\r\n\u003c/pre\u003e"}}]}