#include <stdlib.h>
#include <stdio.h>
#include <math.h>
void main()
{
int numbers;
int i;
long int n;
long double result;
int result_last;
scanf("%d",&numbers);
//printf("\n");
for (i=0;i<numbers;i++)
{
scanf("%d",&n);
//fflush(stdin);
if(n!=1)
{
result=(long)((log10(sqrt(4.0*acos(0.0)*n))+(double)n*(log10((double)n)-log10(exp(1.0))))+1);
result_last=(int)result;
printf("%d\n",result_last);
}
else
printf("1\n");
}
//system("pause");
//return 0;
}
#include <stdio.h>
#include <math.h>
void main()
{
int numbers;
int i;
long int n;
long double result;
int result_last;
scanf("%d",&numbers);
//printf("\n");
for (i=0;i<numbers;i++)
{
scanf("%d",&n);
//fflush(stdin);
if(n!=1)
{
result=(long)((log10(sqrt(4.0*acos(0.0)*n))+(double)n*(log10((double)n)-log10(exp(1.0))))+1);
result_last=(int)result;
printf("%d\n",result_last);
}
else
printf("1\n");
}
//system("pause");
//return 0;
}