#include<stdio.h>
int main()
{
long int i,j,n1,n2,max=0,count,let;
while(scanf("%ld %ld",&n1,&n2)==2)
{
printf("%ld",n1);
printf(" %ld",n2);
max=0;
if(n2<n1)
{
let=n2;
n2=n1;
n1=let;
}
for(j=n1;j<=n2;j++)
{
i=j;
count=1;
while(i!=1)
{
if(i%2==0)
i=i/2;
else
i=3*i+1;
count++;
}
if(count>max)
max=count;
}
printf(" %ld\n",max);
}
return 0;
}
0 comments:
Post a Comment