#include<stdio.h>
main()
{
long long int n,m,i=0;
while(scanf("%lld%lld",&n,&m)!=EOF)
{
long long int k=1,l,p=n,q=m;
if(n<0 && m<0)
break;
if(n>m)
{
l=m;
m=n;
n=l;
}
{
while(n!=1)
{
if(n%2==0)
{
n=n/2;
{
if(n>m)
break;
}
}
else
{
n=(3*n)+1;
{
if(n>m)
break;
}
}
k++;
}
}
i++;
printf("%lld",i);
printf("Case %lld: A = %lld, limit = %lld, number of terms = %lld\n",i,p,q,k);
}
}
main()
{
long long int n,m,i=0;
while(scanf("%lld%lld",&n,&m)!=EOF)
{
long long int k=1,l,p=n,q=m;
if(n<0 && m<0)
break;
if(n>m)
{
l=m;
m=n;
n=l;
}
{
while(n!=1)
{
if(n%2==0)
{
n=n/2;
{
if(n>m)
break;
}
}
else
{
n=(3*n)+1;
{
if(n>m)
break;
}
}
k++;
}
}
i++;
printf("%lld",i);
printf("Case %lld: A = %lld, limit = %lld, number of terms = %lld\n",i,p,q,k);
}
}
কোন মন্তব্য নেই:
একটি মন্তব্য পোস্ট করুন