1 /*
2 * File: 100.cpp
3 * Author: GongZhi
4 * Problem: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=29&page=show_problem&problem=36
5 * Created on 2009年7月25日, 下午9:01
6 */
7
8 #include <stdlib.h>
9 #include <string.h>
10 #include <iostream>
11 #include <string>
12 #include <vector>
13 #include <map>
14 #include <queue>
15 using namespace std;
16
17 /*
18 *
19 */
20 int f(int i) {
21 if (i == 1)
22 return 1;
23 else if (i % 2)
24 return f(i * 3 + 1) + 1;
25 else
26 return f(i / 2) + 1;
27 }
28
29 int main() {
30 int i, j;
31 int r, l, t;
32 int rr, ll;
33 int ans;
34 while (scanf("%d%d", &r, &l) != EOF) {
35 rr = r;
36 ll = l;
37 if (r > l) {
38 t = r;
39 r = l;
40 l = t;
41 }
42 ans = 0;
43 for (i = r; i <= l; i++)
44 if (f(i) > ans) ans = f(i);
45 printf("%d %d %d\n", rr, ll, ans);
46 }
47 return 0;
48 }
49
50
51