#include<stdio.h>
int main()
{
int i, n, m, count = 1, max = 0, a;
while(scanf("%d %d", &n, &m))
{
max = 0;
for(i=n; i<=m; i++)
{
a = i;
count = 1;
while(a != 1)
{
count++;
if(a%2 != 0)
{
a = (3 * a) + 1;
}
else
{
a = a/2;
}
}
if(count > max)
{
max = count;
}
}
printf("%d %d %d\n", n, m, max);
}
return 0;
}
Comments
Post a Comment