#include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
int main()
{
int test;
long long n, count , sum, rem , d;
scanf("%d",&test);
while (test--)
{
scanf("%lld",&n);
d=n;
count=0;
while(1)
{
sum=0;
while (d>0)
{
rem=d%10;
sum=sum*10+rem;
d=d/10;
}
if (n==sum)
{
break;
}
else
{
d = sum+n;
n = sum+n;
count++;
}
}
printf("%lld %lld\n", count , n);
}
return 0;
}
No comments:
Post a Comment