main()
{
      char S[N];
      int i,j,count=0,k,l[n];
      gets(S);
      for(i=0,j=0;;i++)
      {
                      if(S[i]!=' '&&S[i]!='\0')
                      count++;
                      else
                      {
                          if(count!=0)
                          {
                                      l[j]=count;                          }
                          if(j!=0&&count!=0)
                          {
                                  printf(",");
                          }
                          if(count!=0)
                          {
                                  printf("%d",l[j]);
                                  j++;count=0;
                          }
                      }
                      if(S[i]=='\0')
                      break;
      }
      getchar();
      getchar();
      return 0;
}


void main()
{
	char c[30];
	int k,i;
	scanf("%s",c);
	k=strlen(c);
	printf("%d",k);
	for(i=0;i<k;i++)
		c[i]='\0';

	while(scanf("%s",c)!=EOF)
	{
		k=strlen(c);
		printf(",%d",k);
		for(i=0;i<k;i++)
		c[i]='\0';
	}
}


int main(int argc, char* argv[])
{
	int i,n,a;
	char str[100];
	scanf("%s",str);
	printf("%d",strlen(str));

	while(scanf("%s",str)!=EOF)
	{
		a=strlen(str);
		printf(",%d",a);
	         char str[100];
	}
	return 0;
}


char str[10000];

int main()
{
	int i,n,word,temp,start;
	gets(str);
	n=strlen(str);
	word=0;
	temp=0;
	start=0;
	for(i=0;i<n;i++)
	{
		if(str[i]!=' ')
		{
			word++;
			temp=0;
		}
		else if(temp==0)
		{
			if(start==0)
			{
				printf("%d",word);
				start++;
			}
			else printf(",%d",word);
			word=0;
			temp=1;
		}
	}
	if(start==0)
			printf("%d",word);
	else printf(",%d",word);

	return 0;
}


void main()
{
	char a[1001];
	gets(a);
	int l=strlen(a);
	int index=1,num[301]={0};
	int i,n=0;
	for(i=0;i<l;i++)
	{
		if(a[i]==' '&&index==0)
		{
			index=1;
			n++;
		}
		else if(a[i]!=' '&&index==1)
		{
			num[n]++;
			index=0;
		}
		else if(a[i]!=' '&&index==0)
			num[n]++;
		else index=index;
	}
	if(n==0)
		printf("%d",num[0]);
	else{
	for(i=0;i<n;i++)
		printf("%d,",num[i]);
	printf("%d",num[n]);
}
}


int main(){
	char zfc[6000];
	gets(zfc);
	int i, j, k=1,len, num[305], time=0, sum=0, sum2=0;
	len=strlen(zfc);
	num[0]=0;
	for(i=0;i<len;i++){
		if(zfc[i]==' '){
			sum=sum+num[k-1];
			time++;
			while(zfc[i+1]==' '){
				time++;
				i++;
			}
			num[k]=i-time-sum+1;
			k++;
		}
	}
	for(i=0;i<k;i++){
		sum2+=num[i];
	}
	num[k]=len-time-sum2;
	for(i=1;i<k;i++){
		printf("%d,", num[i]);
	}
	printf("%d", num[k]);
	return 0;
}


void main()
{
	char string[6000];
	int i,word=0;
	char c;
	gets(string);
	for(i=0;((c=string[i])!='\0');i++)
	{  if(c!=' ')
		{
			 if(string[i+1]!='\0')
			{word=word+1;
				}
			else if(string[i+1]=='\0')
			printf("%d",word+1);

		}
	else	if(c==' ')
	      {if(string[i-1]!=' ')
	      {	printf("%d,",word);
	      	word=0;}
	      	else ;
	      }
	}
}


double cal(int i,int n,double x)
{ double s;
  if (i==n)  return x;
  else{ s=1+1/cal(i+1,n,x);return s;}//1+1/cal(i+1,n,x);
}
int main()
{

	double x;int i,j,k,l, m,n,y;
   scanf("%d",&m);
   for (i=1;i<=m;i++)
   {scanf("%d",&y);
    x=0;for (j=0;j<=y-1;j++) x+=cal(0,j,2.0);
	printf("%.3lf\n",x);}

}


double f(int n)
{
	if(n==1)
	{
		return 2.0;
	}
	else
	{
		return 1/f(n-1)+1.0;
	}
}
int main()
{
	int a,i,m,j;
	double sum;
	scanf("%d",&a);
	for(i=0;i<a;i++)
	{
		sum=0.0;
		scanf("%d",&m);
		for(j=1;j<m+1;j++)
		{
			sum+=f(j);
		}
		printf("%.3lf\n",sum);
	}
	return 0;
}


int main()
{
	int m;
	scanf("%d",&m);
	for(int i=0;i<m;i++)
	    {
		int n;
		scanf("%d",&n);
		float *a=(float *)malloc((n+i)*sizeof(float));
		float *b=(float *)malloc((n+i)*sizeof(float));
		a[0]=1.0;
		a[1]=2.0;
		b[0]=2.0;
		b[1]=3.0;
		for(int j=2;j<n;j++)
		    {
			a[j]=a[j-1]+a[j-2];
			b[j]=b[j-1]+b[j-2];
			}
		float sum=0;
		for(int j=0;j<n;j++)
		    sum+=b[j]/a[j];
		printf("%.3f\n",sum);
		}
}


int main()
{
	float f(int j);
	int i,n,m,k;
	float s=0;
	scanf("%d\n",&m);
	for(k=0;k<m;k++)
	{s=0;
		scanf("%d",&n);
	    for(i=0;i<n;i++)

         s=s+f(i+3)/f(i+2);
         	printf("%.3lf\n",s);

	}

	return 0;

}
 float f(int j)
 { int c;
	 if (j==1||j==2)
		 c=1;
	 else c=f(j-1)+f(j-2);
	 return(c);
 }


int main()
{
    int m,n,j,i;
    double x=2,y=1,a;
    double sum=0;
    scanf("%d",&m);
    for(i=0;i<m;i++){
      scanf("%d",&n);
      for(j=0;j<n;j++){
      sum=sum+x/y;
      a=x;
      x=a+y;
      y=a;
      }
      printf("%.3lf\n",sum);
      sum=0;
      x=2;
      y=1;
    }
    scanf("%d",&n);
    return 0;
}


double f(int n)
{
    if(n==0)
       return 1.000;
    else if(n==1)
       return 2.000;
    else
       return f(n-1)+f(n-2);
}
double g(int n)
{
        double z=0.000;
    for (int i=0;i<n;i++)
    {
        z=z+f(i+1)/f(i);
    }
    return z;
}
main()
{
    int m,n;
    scanf("%d",&m);
    for(int i=0;i<m;i++)
    {
            scanf("%d",&n);
            printf("%.3f\n",g(n));
    }
    getchar();
    getchar();
}


int main(int argc, char* argv[])
{
	int m,n,i;
	double a=1.0,b=1.0,c,sum=0.0;
	scanf("%d",&m);
	for(int j=0;j<m;j++)
	{
		scanf("%d",&n);
        a=1.0,b=1.0,c,sum=0.0;
	    for(i=1;i<=n;i++)
		{

		   a=a+b;
		   b=a-b;
	       c=a/b;
	       sum+=c;
		}

		printf("%.3lf\n",sum);
	}

	return 0;
}


double F(int r);
int main(){
	int m,n[100],i,r;
	double result;
	scanf("%d",&m);
	for(i=0;i<m;i++){
		scanf("%d",&n[i]);
	}
    for(i=0;i<m;i++){
		r=n[i];
		result=F(r);
		printf("%.3lf\n",result);
	}
	return 0;
}
double F(int r){
	int j;
	double fz,fm,n1=1.0,n2=2.0,n3=3.0,h=3.500;
	if(r==1)
		return 2.000;
	if(r==2)
		return 3.500;
	for(j=1;j<r-1;j++){
		fz=n2+n3;
		fm=n1+n2;
		h=h+fz/fm;
		n1=n2;
		n2=n3;
		n3=fz;
	}
	return h;
}


double calculate(int m)
{
	double sum;
	int a,b,c,i;
	a=1;
	b=2;
	sum+=b*1.0/a;
	for(i=1;i<=m-1;i++)
	{
		c=a+b;
		a=b;
		b=c;
		sum+=b*1.0/a;
	}
	return sum;
}
void main()
{
	int n,i,m;
	double sum;
	scanf("%d",&n);
	for(i=1;i<=n;i++)
	{
		scanf("%d",&m);
		sum=calculate(m);
		printf("%.3f\n",sum);
	}
}


double fnt(int n);
int main()
{
	int z,j,k,l;
	double sz[50];
	double sum=0,s;
	scanf("%d",&z);
    for(j=0;j<z;j++){
        scanf("%d",&k);
		for(l=0;l<k;l++){
			s=fnt(l+1)/fnt(l);
			sum=sum+s;
		}
		sz[j]=sum;
		sum=0;
	}
	for(j=0;j<z;j++){
	    printf("%.3lf\n",sz[j]);
	}
	return 0;
}
double fnt(int n){
	double m,a=2,b=1;
	if(n==0)
		m=1;
    if(n==1)
		m=2;
    if(n>1){
		for(int i=1;i<n;i++){
			m=a+b;
			b=a;
			a=m;
		}
	}
	return m;
}


int fei(int n) {
	if(n == 1) return 1;
	if(n == 2) return 2;
	if(n > 2) {
		int a = fei(n - 1) + fei(n - 2);
		return a;
	}
}

int main() {
	int m;
	cin >> m;
	for(int k = 0; k < m; k++) {
	int n;
	cin >> n;
	int a = 1; /* to calculate the numerator */
	int b = 1;    /* to calculate the denominator */
	double t;  /* to calculate the item of the formula */
	double sum = 0;
	for(int i = 1; i <= n; i++) {
		a = fei(i + 1);
		b = fei(i);
		t = (double)(a) / (double)(b);
		sum += t;
	}
	printf("%.3lf\n", sum);
	}
	return 0;
}


int fbnq(int a)
{
	if(a==1){
		return 1;
	}
	else{
		if(a==2){
			return 2;
		}
		else{
			return fbnq(a-1)+fbnq(a-2);
		}
	}
}
int main()
{
	int n,i,k,j;
	int sz[100];
	float jieguo[100]={0};
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d",&sz[i]);
	}
	for(k=0;k<n;k++){
		for(j=1;j<=sz[k];j++){
			jieguo[k]=jieguo[k]+(float)fbnq(j+1)/fbnq(j);
		}
		printf("%.3f\n",jieguo[k]);
	}
	return 0;
}


int main(){
	int m,n,i,j,fenzi=2,fenmu=1;
	double result[100]={0};
	scanf("%d",&m);

	for(i=0;i<m;i++){
		scanf("%d",&n);
		fenzi=2;
		fenmu=1;
		for(j=1;j<=n;j++){
			result[i]+=1.0*fenzi/fenmu;
			fenzi=fenmu+fenzi;
			fenmu=fenzi-fenmu;

		}
	}
	for(i=0;i<m;i++){
		printf("%.3lf\n",result[i]);
	}
	return 0;
}


int main()
{
    int m;
    scanf("%d",&m);
    for(int i=0;i<m;i++)
    {
         int n;
         scanf("%d",&n);
         float s=0;
         int x=2,y=1,t;
         for(int j=1;j<=n;j++)
         {
              s=s+(float)x/y;
              t=x+y;
              y=x;
              x=t;
         }
         printf("%.3f\n",s);

    }

    getchar();
    getchar();
}


double f(double n){
	double result=0,a=1,b=2,e,c,i;

	for(i=0;i<n;i++)
	{
		result+=b/a;
        e=a+b;
        c=b;
		a=c;
		b=e;
	}
return (result);
}
int main()
{

	int n,i;
	double m[100][2];
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%lf",&(m[i][0]));
		m[i][1]=f(m[i][0]);
	}
	for(i=0;i<n;i++)
	{
		printf("%.3lf\n",m[i][1]);
	}

return 0;
}


void main()
{
	int a,b,c,i;
	int n,m;
	double sum;
	scanf("%d",&n);
	while (n>0)
	{
		scanf("%d",&m);
		sum=0;
		a=1;b=2;
		for (i=1;i<=m;i++)
		{
			sum+=(double)(b)/a;
			c=b+a;
			a=b;
			b=c;
		}
		printf("%.3f\n",sum);
		n--;
	}
}


int main()
{
	int n,i,j;
	int sz[100];
	double jieguo[100],fbnq[100];
	scanf("%d",&n);
	fbnq[0]=1;fbnq[1]=2;
	for(i=2;i<100;i++)
	{
		fbnq[i]=fbnq[i-2]+fbnq[i-1];
	//printf("%lf",fbnq[i]);
	}

	for(i=0;i<n;i++)
	{
		jieguo[i]=0;
	}
	for(i=0;i<n;i++)
	{
		scanf("%d",&sz[i]);
		for(j=0;j<sz[i];j++)
		{
			jieguo[i]=jieguo[i]+fbnq[j+1]/fbnq[j];
		}

	}
	for(i=0;i<n;i++)
		printf("%.3lf\n",jieguo[i]);
	return 0;
}


int f(int n)
{
	int a;
	if(n==1)
	{a=1;}
	if(n==2)
	{a=2;}
	if(n>2)
	{a=f(n-1)+f(n-2);}
	return a;
}

int main()
{
   int m,i;
   scanf("%d",&m);
   for(i=0;i<m;i++)
   {
	   int l,j;
	   scanf("%d",&l);
	   float sum=0;
	   for(j=2;j<=l+1;j++)
	   {
		   sum+=(float)f(j)/(float)f(j-1);
	   }
	   printf("%.3f\n",sum);
   }
   return 0;
}


int main()
{
    int m,n,i,k=1;
    float sum,d,a,b,c;
    scanf("%d",&m);
    a=1,b=2,sum=0;
    for(i=1;i<=m;i=i+1)
    {
        scanf("%d",&n);
         while(k<=n)
         {
                    d=b/a;
                    sum=sum+d;
                    c=b;
                    b=b+a;
                    a=c;
                    k=k+1;
         }
         printf("%.3f\n",sum);
         sum=0;
         k=1;a=1;b=2;c=2;

    }
         return 0;
}


main()
{
      int a[100],m,i,k;
      float n,a1,a2,a3;
      scanf("%d",&m);
      i=0;
      while(i<m)
      {
                scanf("%d",&a[i]);
                i=i+1;
      }
      i=0;
      while(i<m)
      {
                a1=1;
                a2=2;
                n=0;
                k=1;
                while(k<=a[i])
                {
                    n=a2/a1+n;
                    a3=a2;
                    a2=a1+a2;
                    a1=a3;
                    k=k+1;
                    }
                    printf("%.3f\n",n);
                    i=i+1;
                    }
                    getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();
                    }


int main(){
	int m;
	int xiangshu;
	int shulie[100];
	double result[100];
	double sum[100];
	int i;
	int j;
	for(i=0;i<100;i++){
		sum[i]=0.0;
	}
	shulie[0]=1;
	shulie[1]=2;
	for(i=2;i<100;i++){
		shulie[i]=shulie[i-1]+shulie[i-2];
	}
	for(i=0;i<99;i++){
		result[i]=shulie[i+1]*1.0/shulie[i];
	}
	scanf("%d",&m);
	for(i=0;i<m;i++){
		scanf("%d",&xiangshu);
		for(j=0;j<xiangshu;j++){
			sum[i]+=result[j];
		}
	}
	for(i=0;i<m;i++){
		printf("%.3lf\n",sum[i]);
	}
	return 0;
}


int main()
{
	int m,u;
	scanf("%d", &m);
	int n,i;
	for(u=0;u<m;u++){
		double s=0;
                  	double a=2,b=1;
		scanf("%d", &n);
		for(i=0;i<n;i++){
			double t=0;
			s+=a/b;
			t=a;
			a+=b;
			b=t;
		}
		printf("%.3lf\n", s);
	}
	return 0;
}


int tiffany(int i)
{
	int diamond;
	if(i==1)
		diamond=2;
	else if(i==2)
		diamond=3;
	else
		diamond=tiffany(i-1)+tiffany(i-2);
	return diamond;
}
int chanel(int i)
{
	int pearl;
	if(i==1)
		pearl=1;
	else if(i==2)
		pearl=2;
	else
		pearl=chanel(i-1)+chanel(i-2);
	return pearl;
}
int main()
{
	int m,k,n,i,diamond,pearl;
	double jewel;
	scanf("%d",&m);
	for(k=1;k<=m;k++)
	{
		scanf("%d",&n);
		jewel=0;
		for(i=1;i<=n;i++)
		{
			diamond=tiffany(i);
			pearl=chanel(i);
			jewel+=(double)diamond/(double)pearl;
		}
		printf("%.3f\n",jewel);
	}

	return 0;
}


int main()
{
	int m,i,j,n,x,y,temp;
	double sum,a,b;
	scanf("%d",&m);
	for(i=0;i<m;i++){
		scanf("%d",&n);
		sum=0.0;
		x=1,y=2;
		for(j=1;j<=n;j++){
			sum=sum+(double)y/x;
			temp=x;
			x=y;
			y=x+temp;
		}
		printf("%.3lf\n",sum);
	}
	return 0;
}


int f(int n){
	if(n==1){
		return 1;
	}
	else if(n==2){
		return 2;
	}
	else{
		return f(n-2)+f(n-1);
	}
}
double he(int n)
{
	int i;
	double sum=0;
	for(i=1;i<=n;i++){
		sum+=(double)f(i+1)/f(i);
	}
	return sum;
}

int main(){
	int m,s[100];
	int i,j;

	scanf("%d",&m);
	for(i=0;i<m;i++)
	{
		scanf("%d",&s[i]);
	}

	for(j=0;j<m;j++){
		printf("%.3lf\n",he(s[j]));
	}

	return 0;
}


int main(){
    int m,n,e;
    int i=0,j=0;
    double sum=0;
    scanf("%d",&m);
    for(i=0;i<m;i++){
       scanf("%d",&n);
       int k=2,l=1;
       for(j=0;j<n;j++){
          sum=sum+(double)k/l;
          e=k;
          k=k+l;
          l=e;
       }
       printf("%.3lf\n",sum);
	   sum=0;
    }
    return 0;
}


int main(){
  double a,b,e,s;
  int m,n;
  scanf("%d",&m);
  for(int i=1;i<=m;i++){
	s=0;
	a=1;
	b=2;
	scanf("%d",&n);
	for(int j=1;j<=n;j++){
		s=s+b/a;
		e=a+b;
		a=b;
		b=e;
	}
	printf("%.3lf\n",s);
}
	return 0;
}


int fei(int n);
int main()
{
	int n,i,j,a;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d",&a);
		double s=0;
		for(j=1;j<=a;j++){
			s+=(double)(1.0*fei(j+1)/fei(j));
		}
		printf("%0.3lf\n",s);
	}
	return 0;
}

int fei(int n){
	int f,i;
	int p1=1,p2=2;
	if(n==1){
		return p1;
	}else if(n==2){
		return p1+p1;
	} else{
        for(i=0;i<n-2;i++){
	     	f=p2+p1;
		    p1=p2;
	    	p2=f;
		}
		return p2;
	}
}


int f1(int n)
{
	if(n==1||n==2)
		return 1;
	else return f1(n-1)+f1(n-2);
}
int f2(int n)
{
	if(n==1||n==2)
		return 1;
	else return f2(n-1)+f2(n-2);
}
void main()
{
	int n,i,k,j;
	scanf("%d",&k);
	for(j=0;j<k;j++)
	{
		float sum=0;
		scanf("%d",&n);
		for(i=2;i<n+2;i++)
		{
			sum+=(float)f2(i+1)/f1(i);
		}
		printf("%.3f\n",sum);
	}
}


double arr[101] = {0};

int main() {
	double a = 2, prea = 1, b = 1, preb = 1, tmp;
	int n, m;
	for (int i = 1; i < 101; ++i) {
		arr[i] = arr[i-1] + a / b;
		tmp = a;
		a += prea;
		prea = tmp;
		tmp = b;
		b += preb;
		preb = tmp;
	}
	scanf("%d", &m);
	while (m--) {
		scanf("%d", &n);
		printf("%.3lf\n", arr[n]);
	}
}


	int fblq(int n){
if(n==0)
return 1;
if(n==1)
return 2;
return fblq(n-1)+fblq(n-2);
}
int main(){
	int k,m;
	double sum=0;
	scanf("%d",&k);
	for(int i=0;i<k;i++){
	scanf("%d",&m);
	sum=0;
	for(int j=1;j<=m;j++){
		sum+=fblq(j)*1.0/fblq(j-1);
	}
	printf("%.3lf\n",sum);
	}
	return 0;
}


main()
{
     int n;
     scanf("%d",&n);
     for(int i=1;i<=n;i++)
     {
           int m;
           float sum=0;
           scanf("%d",&m);
           float p=2,q=1,pq;
           for(int i=1;;i++)
           {
                 float a;
                 a=p/q;
                 sum=sum+a;
                 if(i==m)
                 {
                      printf("%.3f\n",sum);
                      break;
                 }
                 pq=p;
                 p=p+q;
                 q=pq;
           }
     }
}


void main()
{
    float F_num(int n);
    int m,i=0,j=1;
    int c[1000];
    float sum=0.0;
    scanf("%d",&m);
    while (i<m)
    {
        scanf("%d",&c[i]);
        i++;
    }
    i=0;
    while(i<m)
    {
        while (j<c[i]+1)
        {
            sum+=(F_num(j+1)/F_num(j));
            //printf("%lf\n",F_num(j+1)/F_num(j));
            j++;
        }
        printf("%.3f\n",sum);
        sum=0.0;
        j=1;
        i++;
    }

}

float F_num(int n)
{
    int a=1,b=0,c,i=0;
    while (i<n+1)
    {
        c=a+b;
        a=b;
        b=c;
        i++;
    }
    return (c*1.0);

}


int main()
{
	int n;
	int i=1;
	int p=1;
	float sum=0;
	float m=1;
	float q=2;
	float k;

	int a;

	scanf("%d",&n);
	while(i<=n)
	{
		scanf("%d",&a);
		while(p<=a)
		{
			sum= (float)sum+(q/m);
			k=q;
			q=q+m;
			m=k;
			p=p++;

		}
		p=1;
		printf("%.3f\n",sum);
		m=1;
		q=2;
i=i++;
sum=0;
	}
	return 0;

}


int abc(int n)
{
	if(n==1) return 1;
	if(n==2) return 2;
	if(n>2) return abc(n-1)+abc(n-2);
}

int main()
{
    int i,j,m,n;
	float sum=0;
    scanf("%d",&m);
    for(i=0;i<m;i++)
	{
		scanf("%d",&n);
        for(j=1;j<=n;j++)
		{
			sum+=(float)abc(j+1)/(float)abc(j);
		}
		printf("%.3f\n",sum);
		sum=0;
	}

	return 0;
}


int main()
{
	double a;
	cin>>a;
	while (a>0)
	{
		double b,c,d,f,g;
		cin>>f;
		b=1;
		c=2;
		d=0;//????
		for (g=1;g<=f;g++)
		{
			d=d+c/b;
			double e;
			e=b;
			b=c;
			c=e+c;

		}
        printf("%.3f\n",d);

		a=a-1;
	}

	return 0;
}


int main(int argc, char* argv[])
{

	int m,n,i=0,j=0;
    double sum=0,a=2,b=1;
    scanf("%d",&m);
	for(j=0;j<m;j++)
	{ scanf("%d",&n);
	  for(i=0;i<n;i++)
	  { sum+=(a/b);
	    a+=b;
		b=a-b;
	  }
     printf("%.3lf\n",sum);
   a=2;
   b=1;
   sum=0;

	}

	return 0;
}


int k(int n)
{
	int i;
	int k1=1,k2=2;
	int a;
	if(n>1)
	{
		for(i=1;i<n;i++)
		{
			a=k2;
		    k2=k1+k2;
		    k1=a;
		}
	}
	else if(n=1) k2=2;
	return k2;
}

int main()
{
	int n;
	scanf("%d",&n);
	int i,j;
	for(i=0;i<n;i++)
	{
		int num;
		scanf("%d",&num);
		double sum=2;
		for(j=2;j<=num;j++)
		{
			sum=sum+((double)k(j)/(double)k(j-1));
		}
		printf("%.3lf\n",sum);
	}
}


double F(double x)
{
	double result=0;
	double a=2, b=1, temp;
	int j;
	for(j=0;j<x;j++)
	{
		result+=(double)(a/b);
		temp=a;
		a=a+b;
		b=temp;
	}
	return result;
}

int main()
{
	int m;
	scanf("%d", &m);
	double *shuzu=(double *)malloc(sizeof(double)*m);
	int i;
	for(i=0;i<m;i++)
	{
		scanf("%lf", &(shuzu[i]));
		shuzu[i]=F(shuzu[i]);
	}
	for(i=0;i<m;i++)
	{
		printf("%.3lf\n", shuzu[i]);
	}
	free(shuzu);
	return 0;
}


int main(){
int m,n,fm,fn,i,j;double s=0;
scanf("%d",&m);
for(i=1;i<=m;i++){s=0;scanf("%d",&n);fm=1;fn=1;
for(j=1;j<=n;j++){fm=fm+fn;fn=fm-fn;s+=(1.0*fm)/fn;}

printf("%.3f\n",s);

}

return 0;
}


main()
{
    int m,n;
    scanf("%d",&m);
    for(int i=0;i<m;i++)
    {
        scanf("%d",&n);
        float sum=0;
        float x,y,t;
        x=2;
        y=1;
        for(int j=1;j<=n;j++)
        {
            if(j==1)
            sum=2;
            else
            {
                sum=(x+y)/x+sum;
                t=x;
                x=x+y;
                y=t;
            }
        }
        printf("%.3f\n",sum);
        sum=0;
    }
}


int f(int a)
{if(a==1||a==2) return 1;
else return f(a-1)+f(a-2);
}
double xl(int b)
{
if(b==1) return 2;
else return (double)f(b+2)/f(b+1)+xl(b-1);
}
int main()
{
int n;
scanf("%d",&n);
int i,m;
for(i=0;i<n;i++)
{
scanf("%d",&m);
printf("%.3lf\n",xl(m));
}
return 0;
}


int main ()
{
    int m,n;
    int i,j,k;
    scanf("%d",&m);
    for (k=0;k<m;k++) {
        scanf("%d",&n);
        float s=0;
        float*num=(float*) malloc(sizeof(float)*(2*n+2));
        float*nm=(float*) malloc(sizeof(float)*(n+1));
        num[1]=1;
        num[2]=1;
        for (i=3;i<=2*n+1;i++) {
            num[i]=num[i-2]+num[i-1];
            }
        for (i=1;i<=n;i++) {
            nm[i]=num[i+2]/num[i+1];
            }
        for (i=1;i<=n;i++) {
                s+=nm[i];
                }
        printf("%.3f\n",s);
        free(num);
        free(nm);
        }
    return 0;
}


int main(){
int m,i,a,b,j,temp;
int sz[10000];

double sum=0;
double c;
scanf("%d",&m);
for(i=1;i<=m;i++){
	scanf("%d",&sz[i]);
	sum=0;
a=2;
	b=1;
for(j=1;j<=sz[i];j++){

	c=1.0*a/b;
	temp=a+b;
	sum=sum+c;
    b=a;
	a=temp;
}
printf("%.3lf\n",sum);}
 return 0;
}


int feibo[200]={0};
float fen[100]={0};
int feii(int n)
{
	if(feibo[n])	return feibo[n];
	if(n==1)	return feibo[n]=1;
	if(n==2)	return feibo[n]=2;
	return feibo[n]=feii(n-1)+feii(n-2);
}
int main()
{
	int n,m;
	scanf("%d",&m);
	while(m--)
	{
		int i,j;
		float sum=0;
		scanf("%d",&n);
		for(i=1;i<=n+1;i++)
			feii(i);
		for(i=1;i<=n;i++)
		{
			if(fen[i]==0)
				fen[i]=(float)feibo[i+1]/(float)feibo[i];
			sum+=fen[i];
		}
		printf("%.3f\n",sum);
	}
}


int main()
{	int i,j,m,n;
	scanf("%d",&m);
	int a=2;
	int aa=1;
	int b=1,bb=1;
	int x=0,y=0;
	float sum=2.000;
	for(i=0;i<m;i++){
		scanf("%d",&n);
		for(j=1;j<n;j++){
			x=aa;
			aa=a;
			a=a+x;
			y=bb;
			bb=b;
			b=b+y;
			sum+=(float)a/(float)b;
		}
		printf("%.3f\n",sum);
		a=2;
		aa=1;
		b=1,bb=1;
		x=0,y=0;
		sum=2.000;
	}

	return 0;
}


int main(int argc, char *argv[])
{
  int m,a[100],i,j;
  float nume[100],deno[100];
  float sum;
  scanf("%d",&m);
  for (i=0;i<=m-1;i++)
  {
      scanf("%d",&a[i]);
      nume[0]=2;deno[0]=1;
      for (j=1;j<=a[i]-1;j++)
      {
          nume[j]=nume[j-1]+deno[j-1];
          deno[j]=nume[j-1];
      }
      sum=0;
      for (j=0;j<=a[i]-1;j++)
      {
          sum=sum+nume[j]/deno[j];
      }
      printf("%.3f\n",sum);
  }
  return 0;
}


int main(){
	int m;
	int i,j;
	double e,x,y;
	scanf("%d",&m);
	int*sz
		=(int*)malloc(sizeof(int)*m);
	for(i=0;i<m;i++){
		scanf("%d",&sz[i]);
	}
	for(i=0;i<m;i++){
		double sum=0;
		x=1.0;
		y=2.0;
		for(j=0;j<sz[i];j++){
			sum+=y/x;
			e=y;
			y=x+y;
			x=e;
		}
		printf("%.3lf\n",sum);
	}

	free(sz);

	return 0;
}


float f(int n)
{
	if (n==1||n==2)
	return 1;
	else
	return f(n-1)+f(n-2);
}
main()
{
	int n,m;
	scanf("%d",&m);
	for (int k=1;k<=m;k++)
		{scanf("%d",&n);
		float sum=0;
		for (int i=1;i<=n;i++)
			sum=sum+(f(i+2)/f(i+1));
		printf("%.3f\n",sum);
	}
}


int main(int argc, char* argv[])
{   int i,n,m,j;
	double a,b,s,x,y;
    scanf("%d",&m);
	for(i=0;i<m;i++){
	   scanf("%d",&n);
	   a=2.000;
	   b=1.000;
	   s=0;
	   for(j=0;j<n;j++){
	      s=s+(double)(a/b);
		  x=a;
		  y=a+b;
		  b=x;
		  a=y;
	   }
	   printf("%.3lf\n",s);
	}
	return 0;
}


//
//  main.cpp
//  hw
//
//  Created by ? ? on 12-12-16.
//  Copyright (c) 2012? ? ?. All rights reserved.
//

int main(int argc, const char * argv[])
{
    int x;
    cin>>x;
    for(int q=0;q<x;q++){
    int n,a=2,b=1;
    cin>>n;
    double Sum=0;
    for (int i=1; i<=n; i++) {
        Sum+=(float)a/b;
        int t=a;
        a+=b;
        b=t;
    }
    printf("%.3f\n",Sum);
    }
    return 0;
}


main()
{   int m,i,j,k,num;
    float sum,rst[100];
    int up(int x);
    int down(int x);
    scanf("%d",&m);
    for(i=0;i<m;i++)
    {   scanf("%d",&num);
        for(j=0;j<num;j++)
        {
            sum = sum+((double)up(j+1)/(double)down(j+1));
             }
        rst[i]=sum;
        sum=0;
        }
    for(i=0;i<m;i++)
    {printf("%.3f\n",rst[i]);

        }

    }
int up(int x)
{
    if(x==1)
    return 2;
    if(x==2)
    return 3;
    else
    return up(x-1)+up(x-2);

    }
int down(int x)
{   if(x==1)
    return 1;
    if(x==2)
    return 2;
    else
    return down(x-1)+down(x-2);

    }


int main()
{
    int up,down;
    int temp1,temp2;
    double temp3;
    up=2;down=1;
    int n,m;
    double c,sum;
    scanf("%d",&n);
    int a1,a2,a3,a4,a5,a6,a7,a8,a9,a10;
    for(int i=0;i<=n-1;i++)
    {
        c=(float)2/(float)1;
        sum=c;
        scanf("%d",&m);
        if(m==1)
        {
            printf("2.000\n");
        }
        else
        {
            for(a1=0;a1<=m-2;a1++)
            {
                c=1+1/c;
                sum=sum+c;
            }
        }
        if(m!=1)
        {
            printf("%.3f\n",sum);
        }
    }

}


float b[100];
int he(int n,int m)
{
 int i,k;
 int f1=1,f2=2;
  b[m]=0.0;
 for(i=1;i<=n;i++)
 {
  b[m]=b[m]+f2*1.0/f1;
  k=f1;
  f1=f2;
  f2=k+f2;
 }
 return 0;
}

int main(int argc, char* argv[])
{
  int m,a[100],i;
  int he(int x,int i);
  scanf("%d\n",&m);
  for(i=1;i<=m;i++)
  {
	  scanf("%d\n",&a[i]);
      he(a[i],i);
  }
  for(i=1;i<=m;i++)
	  printf("%.3f\n",b[i]);
	return 0;
}


double f(double x);
double g(double y);
int main()
{
	int i;
	double s,j,n,a[1000];
	scanf("%lf",&n);
	for(i=0;i<=n-1;i++)
	{
		scanf("%lf",&a[i]);
	}
	for(i=0;i<=n-1;i++)
	{
		s=0;
		for(j=1;j<=a[i];j++)
		{

			s+=g(j)/f(j);
		}
		printf("%.3lf\n",s);
	}
	return 0;
}
double f(double x)
{
	if(x==1)
		return 1;
	if(x==2)
		return 2;
	if(x>2)
		return f(x-1)+f(x-2);
}
double g(double y)
{
	if(y==1)
		return 2;
	if(y==2)
		return 3;
	if(y>2)
		return g(y-1)+g(y-2);
}


int main(){
int m,i;
scanf("%d",&m);
double sz[m];
for(i=0;i<m;i++){
int n;
scanf("%d",&n);
int j;
double sum=0.0;
int a=2,b=1,e;
for(j=0;j<n;j++){
double t;
t=1.0*a/b;
sum+=t;
e=b;
b=a;
a=e+b;
}
printf("%.3lf\n",sum);
}
return 0;
}


int main()
{
  double print=0.0;

  int m,n;
  int i,k;
  int *arr;

  scanf("%d",&m);

  for(k=0;k<m;k++)
  {
    print=0.0;
    scanf("%d",&n);
	arr=(int*)malloc(sizeof(int)*(n+2));
	for(i=0;i<n+2;i++)
	{
	  if(i==0||i==1)
		  arr[i]=1;
	  else
		  arr[i]=arr[i-1]+arr[i-2];
	}
	for(i=0;i<n;i++)
	{
	  print+=(double)arr[i+2]/arr[i+1];
	}
     if(k<m-1)
	printf("%.3lf\n",print);
     else
        printf("%.3lf",print);
  }
return 0;
}


double F(int n);
int main(){
	int j,i,n,m;
    double result;

	scanf("%d", &m);
	for (j=0;j<m;j++){
	result=0;
	scanf ("%d",&n);
	for (i=3;i<n+3;i++){
		result += F(i)/F(i-1);}
	printf("%.3lf\n", result);}
	return 0;
}
double F(int n){
double a,b,x,i;
double r;
a=0;
b=1;
if (n==0) return 0;
if (n==1) return 1;
if (n>1){
	for (i=1;i<n;i++){
	x=a;
	a=b;
	r=x+a;
	b=r;
	}
}
return r;
}


int main()
{
    int m,n,i;
    scanf("%d", &m);
    int counter;
    counter=1;

    float sum,a,b,c,d;
    for(;counter<=m;counter++)
    {
    a=1;
    b=2;
    sum=2;

    scanf("%d", &n);
    i=1;
    while(i<n)
    {
    a=a+b;
    c=(float)a/b;
    sum=sum+c;
    i=i+1;
    if(i==n)

    break;
    else
    {
    b=a+b;
    d=(float)b/a;
    sum=sum+d;
    i=i+1;
    }

    }

    printf("%.3f\n", sum);
     }

    return 0;
}


int main()
{
    int n,i,j,a,p=1,q=1,e;
    float  sum=0;
    scanf("%d",&n);
    for(i=1;i<=n;i++){
        scanf("%d",&a);
        for(j=1;j<=a;j++){
           e=p;
           p=p+q;
           q=e;
           sum+=(float)p/q;
        }
        printf("%.3f\n",(float)sum);
        sum=0;
        p=1;
        q=1;
    }
    return 0;
}


int main()
{
    int m=0,n,k=0,x=0;
    double sum=0,a=2,b=1,c=0;
    scanf("%d",&m);
    while(k<m)
    {
              scanf("%d",&n);
              while(x<n)
              {
                        sum=sum+a/b;
                        c=a;
                        a=a+b;
                        b=c;
                        x=x+1;
              }
              printf("%.3lf\n",sum);
              sum=0;
              x=0;
              a=2;
              b=1;
              c=0;
              k=k+1;
             }
   return 0;
}


int f(int n)
{
	if((n==0)||(n==1))
	{
		return 1;
	}
	else
	{
		return f(n-1)+f(n-2);
	}
}
double S(int n)
{
	double a,b,s=0;
	int i;
	for(i=1;i<=n;i++)
	{
		a=f(i);
		b=f(i+1);
		s+=b/a;
	}
	return s;
}
int main()
{
	int m,n,i;
	double sum;
	scanf("%d", &m);
	for(i=0;i<m;i++)
	{
		scanf("%d", &n);
		sum=S(n);
		printf("%.3lf\n", sum);
	}
	return 0;
}


int fibo(int n)
{    int a;
	 if (n==1)
		 a=1;
	 else if (n==2)
		 a=2;
	      else a=fibo(n-1)+fibo(n-2);
	return a;
}
int main()
{
	int n,m;
	double sum=0.0;
	int i,j,k;
	scanf("%d",&n);
	for (i=1;i<=n;i++)
	{
		scanf("%d",&k);
		for (j=1;j<=k;j++)
		{
			sum=sum+(double)fibo(j+1)/fibo(j);
		}
		printf("%.3f\n",sum);
		sum=0;
	}
	return 0;
}


int main()
{
    int c;
    int x=1,y=2,z,m;
    double r,s=0;
    scanf("%d",&m);
    int sz[m];
    for(int k=0;k<m;k++)
    {
            scanf("%d",&sz[k]);
    }
    for(int j=0;j<m;j++)
    {
            for(int i=1;i<=sz[j];i++)
            {
                    r=1.0*y/x;
                    z=x+y;
                    x=y;
                    y=z;
                    s+=r;
            }
            printf("%.3lf\n",s);
            s=0;
            x=1;
            y=2;
    }
    while((c=getchar())!='\n'&&c!=EOF);
    clearerr(stdin);
    getchar();
    return 0;
}


int f(int a)
{
	if(a==1 ) return 1;
    else  if(a==2) return 2;
	return f(a-1)+f(a-2);
}
int main()
{
	int n,i,a1,a2,j,m;
	double sum;
	a1=f(1);
	a2=f(2);
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		sum=2;
		scanf("%d",&m);
		for(j=2;j<=m;j++)
		{

	       sum+= (1.0*f(j+1)/f(j));
		}
		printf("%.3lf\n",sum);
	}

	  return 0;
}


int fbnq(int n){
	if(n==0){
		return 0;
	}
	if(n==1){
		return 1;
	}
	return fbnq(n-1)+fbnq(n-2);
}
int main(){
	int n;
	int no[100];
	scanf("%d",&n);
	int i,j;
	double sum;
	for (i=0;i<n;i++){
	scanf("%d",&no[i]);
	}
	for (j=0;j<n;j++){
		sum=0;
		for (i=1;i<=no[j];i++){
			sum+=(double)fbnq(i+2)/((double)fbnq(i+1));
		}
		printf("%.3f\n",sum);
	}

	return 0;
}


int main()
{
	int m,n,i,j,a=2,b=1,c;
	double sum=2.0;
	cin>>m;
	for(i=0;i<m;i++)
	{
		cin>>n;
		for(j=1;j<n;j++)
		{
			c=b;
			b=a;
			a=a+c;
			sum=sum+a*1.0/b;
		}
		cout<<fixed<<setprecision(3)<<sum<<endl;
		a=2,b=1,sum=2.0;
	}
	return 0;
}


double FindFBN( int nplus2,  int* FBNplus2)
{
	int i=0;
	double dSum=0.0;

	FBNplus2[0]=1;
	FBNplus2[1]=1;
	for (i=2; i<nplus2; i++)
	{
		FBNplus2[i]=FBNplus2[i-1]+FBNplus2[i-2];
	}

	for (i=0; i<nplus2-2; i++)
	{
		dSum+=((double)(FBNplus2[i+2])/(double)(FBNplus2[i+1]));
	}
	printf("%.3lf\n",dSum);
	return dSum;
}

int main(int argc, char* argv[])
{
	int m;
	int i;
	int *FBNum ;
	int ** FBArray;
	double dSum;

	scanf("%d",&m);
	FBNum = (int *)malloc(m*sizeof(int));
	FBArray =(int**) malloc(m*sizeof(int*));

	for (i=0; i<m; i++)
	{
		scanf("%d", &FBNum[i]);
	}

	for (i=0; i<m; i++)
	{
		FBArray[i] = (int *) calloc((FBNum[i]+2), sizeof(int));
		dSum = FindFBN(FBNum[i]+2, FBArray[i]);
	}

	return 0;
}


int main()
{
	float sum=0;
	float a,b,c,d,e,f;
	int i,k,m,n;
	scanf("%d",&m);
	k=1;
	while(k<=m)
	{
		scanf("%d",&n);
		if(n==1)
		{
			sum=2;
		}
		else
		{
			if(n==2)
			{
				sum=3.5;
			}
			else
			{
				i=3;
				a=2;b=1;c=3;d=2;
				sum=3.5;
				while(i<=n)
				{
					e=a+c;f=b+d;
					a=c;b=d;
					c=e;d=f;
					sum=sum+c/d;
					i++;
				}
			}
		}
		printf("%.3f\n",sum);
		k++;
	}
	return 0;
}


double sum(int n){
	int a=1,b=2;

	double c;
	double h=0;
	int i=1;
	int e;
	while(i<=n){
		c=(1.0*b)/(1.0*a);
		h+=c;
		e=a;
		a=b;
		b+=e;
		i++;
	}
	return h;
}

int main()
{
	int m,n;
	double hs;
	scanf("%d",&m);
	for(int mm=0;mm<m;mm++){
		scanf("%d",&n);
		hs=sum(n);
		printf("%.3lf",hs);
		if(mm!=m-1){
			printf("\n");
		}
	}

    return 0;
}


int main (){
int m,n,counta,countb,x,y;
double result;
scanf("%d",&m);
counta=0;
while(counta<m){
	result=0.0;
	countb=0;
	x=2;
	y=1;
	scanf("%d",&n);
		while(countb<n){result+=(1.0*x)/y;
			x=x+y;
			y=x-y;
			countb++;}
	counta+=1;
    printf("%.3lf\n",result);}

return 0;
}


int main(){
double a,b;
double sum[100]={0};
a=2;
b=1;
int n;
int j;
int e;
int m;
scanf("%d",&n);
int k;
for(k=0;k<n;k++){
scanf("%d",&m);
for(j=0;j<m;j++){
sum[k]+=a/b;
e=b;
b=a;
a=e+a;}
a=2;
b=1;

printf("%.3lf\n",sum[k]);
}
return 0;
}


int main(int argc, char* argv[])
{
	double num[100];
	int m,i,j;
	double p;
	double sum;
	scanf("%d",&m);
	for(i=0;i<m;i++){
		scanf("%lf",&num[i]);
	}
	for(i=0;i<m;i++){
		sum=0;
		 p=1;
		for(j=0;j<num[i];j++){
		  p=(double)(p+1)/p;
	      sum+=p;

		}
		printf("%.3lf\n",sum);
	}

	return 0;
}


int main()
{
   int m,n;

scanf("%d",&m);
int i;
double a,b,c;
for(i=0;i<m;i+=1){
	scanf("%d",&n);
	int j;
	double s=0;
	a=2;
	b=1;
	for(j=1;j<=n;j+=1)
	{  s+=a/b;
		c=a;
	 a=a+b;
	b=c;}

printf("%.3lf\n",s);
}
return 0;
}


double sum(int n);
int main(){
  int m,i;
  int sz[100];
  double result=0;
  scanf("%d",&m);
  for(i=1;i<=m;i++){
    scanf("%d",&sz[i]);}
  for(i=1;i<=m;i++){
    result=sum(sz[i]);
    printf("%.3lf\n",result);}
  return 0;
}

double sum(int n){
  int i;
  double a,b,c,d=0,r;
  a=1;
  b=2;
  for(i=1;i<=n;i++){
    r=b/a;
	c=a;
    a=b;
	b=c+a;
	d=d+r;

  }
  return d;

}


int fbnq(int s){
		if(s==0){
			return 0;
		}
		else if(s==1){
			return 1;
		}
		else{
			return fbnq(s-1)+fbnq(s-2);
		}
	}
int main(){
	float sum[100]={0};
	int i,n,d[100],j;
	scanf("%d",&n);
	for (i=0;i<n;i++){
		scanf("%d",&d[i]);
		for(j=2;j<=d[i]+1;j++){
			sum[i]+=(float)fbnq(j+1)/fbnq(j);
		}
	}
	for(i=0;i<n;i++){
		printf("%.3f\n",sum[i]);
	}
	return 0;
}


int fbnq(int);
void main()
{
	int m,n[100],i,j;
	double k[100];
	double sum[100]={0};
	scanf("%d",&m);
	for(i=0;i<m;i++){
		scanf("%d",&n[i]);
	}
	for(i=0;i<m;i++){
		for(j=0;j<n[i];j++){
			k[j]=(double)fbnq(j+3)/fbnq(j+2);
			sum[i]+=k[j];
		}
	}
	for(i=0;i<m;i++){
		printf("%.3lf\n",sum[i]);
	}
	return;
}
int fbnq(int n){
	if(n==0){
		return 0;
	}
	if(n==1){
		return 1;
	}
	return fbnq(n-1)+fbnq(n-2);
}


double f(int n)
{
	if(n==1)
		return 1;
	else if(n==2)
		return 2;
	else
		return f(n-1)+f(n-2);
}
int main()
{
	int n;
	scanf("%d",&n);
	int i,j;
	int sz[1000];
 	for(i=0;i<n;i++)
		scanf("%d",&sz[i]);
	for(i=0;i<n;i++)
	{
		double sum=0;
		for(j=1;j<=sz[i];j++)
		{
			sum+=f(j+1)/f(j);
		}
		printf("%.3lf\n",sum);
	}
	return 0;
}


int main(int argc, char *argv[])
{
    double x;
    int n,s,f[100]={1,2};
    for(s=2;s<100;s++)
    f[s]=f[s-1]+f[s-2];
    cin>>n;
    for(;n>0;n--)
    {
        x=0;
        cin>>s;
        for(;s>0;s--)
        {
            x=x+(double)f[s]/(double)f[s-1];
        }
        cout<<fixed<<setprecision(3)<<x<<endl;
    }
    return EXIT_SUCCESS;
}


int f(int x);
int main()
{
    int m,n[1000],i,k;
    double sum[1000];
    scanf("%d",&m);
    for(i=0;i<m;i++)
    {
        scanf("%d",&n[i]);
    }
    for(i=0;i<m;i++)
    {
        sum[i]=0;
        for(k=1;k<=n[i];k++)
        {
             sum[i]=sum[i]+f(k+1)*1.0/f(k);
        }
        printf("%.3lf\n",sum[i]);
    }
    return 0;
}

int f(int x)
{
    if(x==1)
       return 1;
    else if(x==2)
       return 2;
    else
       return (f(x-1)+f(x-2));
}


double add(int n);
int main()
{
    int m;
    scanf("%d",&m);
    int *sz=(int*)malloc(sizeof(int)*m);
    int i;
    for(i=0;i<m;i++){
      scanf("%d",&sz[i]);
    }
    double a;
    for(i=0;i<m;i++){
      a=add(sz[i]);
      printf("%.3lf\n",a);
    }
    return 0;
}
double add(int n){
	double b=2.0,a=1.0,c;
	double s=0;
	for( ;n>0;n--){
		s+=b/a;
		c=a;
	    a=b;
        b=c+b;
	}
	return s;
}


int main()
{
	int m,n[100],i,str;
	scanf("%d",&m);
	for(i=0;i<m;i++)
	{
		scanf("%d",&n[i]);
	}
	for(i=0;i<m;i++)
	{
		double sum=0;
		int p=1,q=2,t=0;
		while(t<n[i])
		{
			sum+=(double)q/p;
			str=q;
			q=p+q;
			p=str;
			t++;
		}
		printf("%.3lf\n",sum);
	}
	return 0;
}


main()
{
   int m,n[100];
   scanf("%d",&m);
   int i,j;
   float sum;
   int a,b,t;
   for(i=0;i<m;i++)
    {
     scanf("%d",&n[i]);
     sum=0;
     a=1;
     b=2;
     for(j=1;j<=n[i];j++)
     {
       sum=sum+(float)b/a;
       t=a+b;
       a=b;
       b=t;
     }
     printf("%.3f\n",sum);
  }

 }


int main()
{
	int m,n;
	float a=1,b=2,c,s=0;
	scanf("%d",&m);
	float *result=(float *)malloc(sizeof(float)*m);
	for(int i=0;i<m;i++)
	{
		scanf("%d",&n);
		for(int k=0;k<n;k++)
		{
			s+=b/a;
			c=a+b;
			a=b;
			b=c;

		}
		result[i]=s;
		s=0;
		a=1;
		b=2;
	}
	for(int i=0;i<m;i++) printf("%.3f\n",result[i]);
	return 0;
}


int main()
{
 int m,n;
 int fenzi,fenmu,e;
 double s=0;
 scanf("%d",&m);
 for(int i=1;i<=m;i++)
 {
  fenmu=1;
  fenzi=2;
  scanf("%d",&n);
  s=0;
  for(int j=1;j<=n;j++)
  {
   s+=(double)fenzi/fenmu;
   e=fenzi;
   fenzi=fenzi+fenmu;
   fenmu=e;
  }
  printf("%.3lf\n",s);
 }
 return 0;
}


int main()
{
    int m,i,j,s[100];
	scanf("%d",&m);
		for(j=1;j<=m;j++){
           scanf("%d",&s[j]);
		}
	for(j=1;j<=m;j++){
		int a=2,b=1;
	    double sum=(double)a/b;
	    for(i=1;i<s[j];i++)
	{
		int c=a+b;
		b=a;
		a=c;
		double x=(double)a/b;
		sum=sum+x;
	}
	printf("%.3lf\n",sum);
	}
return 0;
}


int main()
{
int m;
for (scanf("%d",&m);m--;)
{
int n;
scanf("%d",&n);
double tot=0;
double a,b;
a=1;b=2;
while (n--)
{
tot+=b/a;
int c=a+b;a=b;b=c;
}
printf("%.3f\n",tot);
}
return 0;
}


main()
{
int n,i,j;
int z,m,a[100];
float val;

scanf("%d",&n);

for(i=0;i<n;i++)
{scanf("%d",&a[i]);}

for(i=0;i<n;i++)
{val=0;
 z=2;
 m=1;
	for(j=0;j<a[i];j++)
	{
		val=val+(float)z/(float)m;
		z=m+z;
		m=z-m;
	}
printf("%.3f\n",val);
}
return 0;
}


double F(double x);
double f(double y);
int main()
{
	int m,i;
	scanf("%d",&m);
	for(i=1;i<=m;i++)
	{
		double a=0.0,n;
		scanf("%lf",&n);
		int k=1;
		for(k=1;k<=n;k++)
		{
			a=a+(F(k)/f(k));
		}
		printf("%.3lf\n",a);
	}
	return 0;
}
double F(double x)
{
	double sz[500];
	if(x==1){return 2.0;}
	if(x==2){return 3.0;}
	int b;
	for(b=3;b<=x;b++)
	{
		sz[1]=2.0;sz[2]=3.0;
		sz[b]=sz[b-1]+sz[b-2];
	}
	return sz[(int)x];
}
double f(double y)
{
	double zs[500];
	if(y==1){return 1.0;}
	if(y==2){return 2.0;}
	int c;
	for(c=3;c<=y;c++)
	{
		zs[1]=1.0;zs[2]=2.0;
		zs[c]=zs[c-1]+zs[c-2];
	}
	return zs[(int)y];
}


double qh(int n);
int main(){
	int m,k;
	int x[10000];
	scanf("%d",&m);
	for(k=0;k<m;k++){
		scanf("%d",&x[k]);
	}
	int *ptr;
	for(k=0;k<m;k++){
		ptr=&x[k];
		printf("%.3lf\n",qh(*ptr));
	}
	return 0;
}
double qh(int n){
	int i;
	double f1=1.0,f2=2.0;
	double cur=f2/f1,e;
	for(i=2;i<=n;i++){
		e=f2;
		f2=f1+f2;
		f1=e;
		cur+=f2/f1;
	}
	return cur;
}


int FB(int n)
{
	int a = 0;
	if(n==0)a=1;
	else if(n==1)a=2;
	else a = FB(n-1) + FB(n-2);
	return a;
}
int main(int argc, char* argv[])
{
	int m;
	scanf("%d",&m);
	int *n = (int *)malloc(sizeof(int)*m);
	double *h = (double *)malloc(sizeof(double)*m);
	int i ;
	for(i=0;i<m;i++)
	{
		h[i] = 0;
		scanf("%d",&n[i]);
		int j;
		for(j=0;j<n[i];j++)
			h[i]+= (double)FB(j+1)/FB(j);
	}
	for(i=0;i<m;i++)
		printf("%.3f\n",h[i]);
	return 0;
}


int main(void){
	int m;
	scanf("%d", &m);
	while(m--){
		int n, i;
		double res = 0;
		double temp1 = 1.0, temp2 = 2.0;
		scanf("%d", &n);
		for(i = 0; i < n; ++i){
			res = res + temp2/temp1;
			temp2 += temp1;
			temp1 = temp2 - temp1;
		}
		printf("%.3lf\n", res);
	}
}


int Pe(int n);
double he(int n);
double G(int n);
int main(){
	int n;
	scanf("%d",&n);
	int X[100];

	int i;

	for(i=0;i<n;i++){
		scanf("%d",&X[i]);

	}double j;
	for(i=0;i<n;i++){
		j=he(X[i]);
		printf("%.3lf\n",j);
	}

	return 0;
}
double he(int n){
	double Q;
	if(n==1){
		Q=2/1;
	}else{
		Q=he(n-1)+G(n);
	}
	return Q;
}
double G(int n){
	double Y;
	if(n==1){
		Y=2/1;
	}else{
		Y=(double)Pe(n+1)/Pe(n);
	}
	return Y;
}
int Pe(int n){
	int H;
	if(n==1){
		H=1;
	}else if(n==2){
		H=2;
	}else{
	   H=Pe(n-1)+Pe(n-2);
	   }
	return H;
}


int main(){
	int m,n;
	scanf("%d",&m);
	for (int z=0;z<m;z++){
		scanf("%d",&n);
		double sum=0;
		int x=1,y=2;
		int tmp;
		for(int i=0;i<n;i++){
			sum=sum+(double)y/x;
			tmp=y;
			y=x+y;
			x=tmp;
		}
		if(z!=0){
			printf("\n");
		}
		printf("%.3lf",sum);
	}

	return 0;
}


int main()
{
    int m=1,a,b,c,i,n,j;
    float x,sum;
    scanf("%d",&m);
    for(i=1;i<=m;i++)
    {
                     scanf("%d",&n);
                     a=1;b=1;sum=0;j=1;
                     while(j<=n)
                     {
                                c=a+b;
                                a=b;
                                b=c;
                                x=(float)b/a;
                                sum=sum+x;
                                j=j+1;
                                }
                                printf("%.3f\n",sum);
                                }
                                                          return 0;
                                }


int main()
{
	int n;
	float ai=1,aj,am=0;
	float bi=2,bj,bm=5;
	int a[1000];
	int i,j,m;
	float s=0;
	scanf("%d",&n);
	for(i=1;i<=n;i++)
		scanf("%d",&a[i]);
	for(j=1;j<=n;j++)
	{
		for(m=1;m<=a[j];m++)
		{
			if(m==1) aj=2;else aj=am;
			if(m==1) bj=3;else bj=bm;
			s=s+bi/ai;
			am=ai+aj;
			bm=bi+bj;
			ai=aj;
			bi=bj;
		}
		printf("%.3f\n",s);
		s=0;
		ai=1;
		bi=2;
	}

	return 0;
}


float f(int n)
{
	int k;
	if(n==1) return 1;
	if(n==2) return 2;
	else
	{
		k=f(n-1)+f(n-2);
		return k;
	}
}

int main(int argc, char* argv[])
{
	int m,n,i,j;
	float sum;
	scanf("%d",&m);
	for(i=0;i<m;i++)
	{
		sum=0;
		scanf("%d",&n);
		for(j=1;j<=n;j++)
		{
			sum+=(float)f(j+1)/f(j);
		}
		printf("%.3f\n",sum);
	}
}


int main(){
	int n,m;
	scanf("%d",&n);
	double sum;
	int i,j;
	int a1,a2,ta,b1,b2,tb;
	for(i=0;i<n;i++){
		scanf("%d",&m);
		sum=0;
		for(j=0;j<m;j++){
			if(j==0){
				a1=2;
				b1=1;
				sum+=(double)a1/(double)b1;
			}else if(j==1){
				a2=3;
				b2=2;
				sum+=(double)a2/(double)b2;
            }else{
				ta=a2;a2=a1;a1=ta;a2=a1+a2;
				tb=b2;b2=b1;b1=tb;b2=b1+b2;
				sum+=(double)a2/(double)b2;
			}
		}
        printf("%.3lf\n",sum);
	}
	return 0;
}


int m,n,i;
double a;
double f(int t)
{int b=1,c=2,p,i;
 a=0;
 for(i=1;i<=t;i++)
 {a+=(double)c/(double)b;
  p=b+c;
  b=c;
  c=p;
 }
 return a;
}
void main()
{scanf("%d",&m);
 for(i=1;i<=m;i++)
 {scanf("%d",&n);
  printf("%.3f\n",f(n));
 }
}


int main()
{
	int n,i,m,j;
		scanf("%d\n",&m);
	for(i=0;i<m;i++){
double sum=0;
		scanf("%d\n",&n);
                  double e=1.0;
		for(j=0;j<n;j++){
			e=1.0+1/e;
			sum+=e;
		}
printf("%.3lf\n",sum);
	}
	return 0;
}


void sum(int n) {
	int front=1;
	int temp;
	int top=2, bottom=1;
	double sum=0;
	int i;
	for (i=0; i<n; i++) {
		sum+=(double)top/front;
		temp=top;
		top+=front;
		front=temp;
	}
	printf("%.3lf\n",sum);
}

int main()
{
	int m, n;
	scanf("%d",&m);
	int i;

	for (i=0; i<m; i++) {
		scanf("%d",&n);
		sum(n);
	}
	return 0;
}


double f(int n)
{
	if(n==1)
		return 2;
	else
		return 1+1/f(n-1);
}
int main()
{
    int m,n,i,j;
    scanf("%d",&m);
    for(i=0;i<m;i++)
	{
		double s=0.0;
		scanf("%d",&n);
		for(j=1;j<=n;j++)
		{
			s+=f(j);
		}
		printf("%.3lf\n",s);
	}
	return 0;
}


int main()
{
	int n, i;
	i=1;
	scanf("%d", &n);
	while(i<=n)
	{
		int x, k;
		float sum, c, a, b;
		scanf("%d", &x);
		a=1;
		b=2;
		k=1;
		sum=0;
		c=2;
		while(k<=x)
		{
			sum=sum+c;
			b=a+b;
			a=-a+b;
			c=b/a;
			k=k+1;
		}
		printf("%.3f\n", sum);
		i=i+1;
	}
	return 0;
}


double f(int n)
{
    if(n==0||n==1)
    return 1;
    else
    return (f(n-1)+f(n-2));
}
int main()
{
    int m,n,w,i;
    double c,d;
    scanf("%d",&m);
    for(w=0;w<m;w++)
    {
        c=0;
        scanf("%d",&n);
        for(i=1;i<=n;i++)
        {
            d=f(i+1)/f(i);
            c=c+d;
        }
        printf("%.3lf\n",c);
    }
    return 0;
}


int main()
{
	float shuzu[NUM],shulie[NUM],qiuhe[NUM],s=0;
	shuzu[0]=1,shuzu[1]=2;
	for(int j=0;j<NUM-2;j++)
	{
		shuzu[j+2]=shuzu[j]+shuzu[j+1];
	}
	for(int i=0;i<NUM-2;i++)
	{
		shulie[i]=shuzu[i+1]/shuzu[i];
	}
	int m;
	scanf("%d",&m);
	for(int k=0;k<m;k++)
	{
		scanf("%f",&(qiuhe[k]));
		for(int l=0;l<qiuhe[k];l++)
		{
			s+=shulie[l];
		}
		printf("%.3f\n",s);
		s=0;
	}
	return 0;
}


int main()
{
	int m,n,i,j,k,l,temp;

	scanf("%d",&m);
	double * sum=(double *)malloc(sizeof(double)*m);
	for(i=0;i<m;i++)
	{
		scanf("%d",&n);
		l=1;k=2;
		sum[i]=0;
		for(j=0;j<n;j++)
		{
           sum[i]=sum[i]+1.0*k/l;
		   temp=l+k;
		   l=k;
		   k=temp;
		}

	}
	for(i=0;i<m;i++)
	{
	printf("%.3lf\n",sum[i]);
	}
    free(sum);
	return 0;
}


int f(int i)
{
 if(i==1)
 return 1;
 if(i==2)
 return 2;
 return f(i-1)+f(i-2);
}
main()
{
 int n,k,i;
 double sum=0;
 scanf("%d",&n);
 while(n--)
 {
  scanf("%d",&k);
  for(i=1;i<=k;i++)
  sum+=((double)(f(i+1)))/((double)(f(i)));
 printf("%.3f\n",sum);
sum=0;
 }
}


int main()
{
	double shuzi[10000]={0};
	double fenshu[10000]={0};
	int i, j;
	int n, m;
	double sum=0;
    shuzi[0]=1;
	shuzi[1]=2;
	for(i=2;i<10000;i++)
	{
		shuzi[i]=shuzi[i-2]+shuzi[i-1];
	}
	for(i=0;i<10000;i++)
	{
		fenshu[i]=shuzi[i+1]/shuzi[i];
	}
	scanf("%d", &m);
	for(j=1;j<=m;j++)
	{
	scanf("%d", &n);
	for(i=0;i<n;i++)
	{
		sum=sum+fenshu[i];
	}
	printf("%.3lf\n", sum);
	sum=0;
	}
	return 0;
}


int main(){
	int m,shuzu[100],i,j;
	double x,s,e,a,b;
	scanf("%d",&m);
	for(i=0;i<m;i++){
		scanf("%d",&shuzu[i]);
	}

	for(i=0;i<m;i++){
		s=0;
		a=1;
		b=2;
		x=b/a;
		for(j=0;j<shuzu[i];j++){
			s=s+x;
			e=a;
			a=b;
			b=e+b;
			x=b/a;
		}
		printf("%.3lf\n",s);
	}
	return 0;
}


double Q(int x);
int main(){
int m,p[100],i;
scanf("%d",&m);
for(i=1;i<=m;i++){
scanf("%d",&p[i]);
}
for(i=1;i<=m;i++){
printf("%.3lf\n",Q(p[i]));
}
return 0;
}
double Q(int x){
	double a=1.0,b=2.0,k,i,s=0;
	for(i=1;i<=x;i++){
	s+=b/a;
	k=a+b;
	a=b;
	b=k;
	}
	return s;
}


int sl(int n){
	if(n==1){
		return 1;
	}
	else if(n==2){
		return 2;
	}
	else{
		return sl(n-1)+sl(n-2);
	}

}
int main()
{
	int m,n,j,i;
	double sum=0;
	scanf("%d",&m);
	for(i=0;i<m;i++){
		scanf("%d",&n);
		sum=0;
		for(j=1;j<=n;j++){
			sum+=(double)sl(j+1)/sl(j);
		}
		printf("%.3lf\n",sum);
	}

	return 0;
}


int main()
{
	int m,n,i,j;
	float a,b,c,s,d;
	scanf("%d",&m);
	j=1;
	while(j<=m)
	{
		scanf("%d\n",&n);
		i=1;
		a=1,b=2;
		s=0;
		while(i<=n)
		{
			c=b/a;
			s=s+c;
			d=b;
			b=a+b;
			a=d;
			i++;}
		printf("%.3f\n",s);
		j++;}
	return 0;
}


int main(int argc, char* argv[])
{
	int m;
	scanf("%d",&m);
	int geshu[1000];
	for(int k=0;k<m;k++)
	{
		scanf("%d",&(geshu[k]));
	}
	double sz[1000];
	double sum=0;
	double a=1,b=2,e;
	for(int i=0;i<m;i++)
	{
		for(int j=0;j<geshu[i];j++)
		{
			sz[j]=1.0*b/a;
			sum+=sz[j];
			e=b;
			b=a+b;
			a=e;

		}
			printf("%.3lf\n",sum);
			sum=0;
			b=2;
			a=1;
	}

	return 0;
}


int main()
{
double n,m,i=0,j,a,b,temp,sum=2;
cin>>n;
while(i<n)
{
cin>>m;
a=2;
b=1;
for(j=1;j<m;j++)
{
temp=a;
a=a+b;
b=temp;
sum+=a/b;
}
printf("%.3f\n",sum);
sum=2;
i++;
}
}


int main()
{
	int m,i,j;
	int sz[1000];
	int fenzi[1000];
	int fenmu[1000];
	double xulie[1000];
	double sum[1000]={0};
	fenzi[0]=2;
	fenmu[0]=1;
	for(i=1;i<1000;i++)
	{
		fenmu[i]=fenzi[i-1];
		fenzi[i]=fenzi[i-1]+fenmu[i-1];
	}
	for(i=0;i<1000;i++)
	{
		xulie[i]=(double)fenzi[i]/fenmu[i];
	}
	scanf("%d",&m);
	for(i=0;i<m;i++)
	{
		scanf("%d",&sz[i]);
	}
	for(i=0;i<m;i++)
	{
		for(j=0;j<sz[i];j++)
		{
			sum[i]+=xulie[j];
		}
	}
	for(i=0;i<m;i++)
	{
		printf("%.3lf\n",sum[i]);
	}
	return 0;
}


int fibonacci(int n)
{
	int a;
	if (n==1||n==2)
		a=1;
	else a=fibonacci(n-1)+fibonacci(n-2);
	return a;
}
int main()
{
	int m,i,j;
	scanf("%d",&m);
	for (i=1;i<=m;i++)
	{
		int n;
		double fenzi,fenmu,result,sum=0.0;
		scanf("%d",&n);
		for (j=1;j<=n;j++)
		{
			fenzi=fibonacci(j+2);
			fenmu=fibonacci(j+1);
			result=fenzi/fenmu;
			sum=sum+result;
		}
		printf("%.3f\n",sum);
	}
	return 0;
}


float f(int n)
{
    float d;
    if(n==0||n==1)
    return 1;
    else
    {
        d=f(n-1)+f(n-2);
    }
    return d;
}
main()
{
      int m,a[1000],j,n,i;
      float c;
      scanf("%d",&m);
      for(i=0;i<m;i++)
      {
            c=0;
            scanf("%d",&n);
            for(j=1;j<=n;j++)
            {
                     c=c+f(j+1)/f(j);
            }
            printf("%.3f\n",c);
      }
      getchar();
      getchar();
}


int main(){
   int m,n;
   scanf("%d",&m);
   for(int i=0;i<m;i++){
       scanf("%d",&n);
       double s=0;
       int a=2,b=1,c;
	   for(int j=1;j<=n;j++){
		   s+=(1.0*a)/b;
		   c=a;
		   a=a+b;
		   b=c;
	   }
	   printf("%.3lf\n",s);
   }
   return 0;
 }


double fs(int n)
{
       int f=0;
       if(n==1)
       f=1;
       else
       {
       if(n==2)
       f=2;
       else
       f=fs(n-1)+fs(n-2);
       }
       return f;
       }
main()
{
      int m;
      scanf("%d",&m);
      for(int j=0;j<m;j++)
      {
              int n;
              scanf("%d",&n);
      double a[n];
      double sum=0;
      int i;
      for(i=0;i<n;i++)
      {
                        a[i]=(fs(i+2))/(fs(i+1));
                        sum+=a[i];
                        }
                        printf("%.3lf\n",sum);
                        }
                        }


int main()
{
int m,q=0;
int n;
double e;
double sz[100];
double b=1.0;
double a=2.0;
double sum=0;
scanf("%d",&m);
for(int i=0;i<m;i++){
	scanf("%d",&n);
	for(int j=0;j<n;j++){
		sum=a/b+sum;
		e=b;
		b=a;
		a=a+e;
	}
	sz[q]=sum;
	q++;
	sum=0;
	b=1.0;
	a=2.0;
}
for(int x=0;x<m;x++){
	printf("%.3lf\n",sz[x]);
}
return 0;
}


int main()
{
	int m,n;
	int p,q,t,i,j;
	float sum;
	scanf("%d",&m);
	for(i=1;i<=m;i++){
		scanf("%d",&n);
		j=1;
		sum=0;
		p=2;
		q=1;
		do{
			sum=sum+(float)p/q;
			t=p;
			p=p+q;
			q=t;
			j=j+1;
		}
		while(j<=n);
		printf("%.3lf\n",sum);
	}
}


int main() {
	int m,n;
	scanf("%d",&m);
	int i;
	int*cs=(int*)malloc(sizeof(int)*m);
	for(i=0;i<m;i++){
		scanf("%d",&cs[i]);
	}
	for(i=0;i<m;i++){
		int*sz=(int*)malloc(sizeof(int)*(cs[i]+1));
		int a=1;
		int b=2;
		int j;
		sz[0]=1;
		sz[1]=2;
		for(j=2;j<=cs[i];j++){
			sz[j]=sz[j-2]+sz[j-1];
		}
		double*sl=(double*)malloc(sizeof(double)*(cs[i]));
		for(j=0;j<cs[i];j++){
			sl[j]=1.0*sz[j+1]/sz[j];
		}
		double sum=0;
		for(j=0;j<cs[i];j++){
			sum+=sl[j];
		}
		printf("%.3lf\n",sum);
		free(sz);
		free(sl);
	}
	return 0;
}


double xs(int n){
	int e;
	int a=1,b=2;
	double sum=0;
	for(int i=1;i<=n;i++){
		if(i==1){
			sum+=(1.0*b)/(1.0*a);
		}
		else{
			e=a+b;
			a=b;
			b=e;
			sum+=(1.0*b)/(1.0*a);
		}
	}
	return sum;
}

int main()
{
	int m;
	scanf("%d",&m);
	int n;
	double h;
	for(int j=1;j<=m;j++){
		scanf("%d",&n);
		h=xs(n);
		printf("%.3lf",h);
		if(j!=m){
			printf("\n");
		}
	}

	return 0;
}


int main(int argc, char* argv[])
{
	int n,a=1,b=2,c;
	scanf("%d",&n);
	int x;
	double s[100]={0};
	for(int i=0;i<n;i++)
	{
		scanf("%d",&x);
		for(int j=0;j<x;j++)
		{
			s[i]=s[i]+(double)b/a;
			c=a;
			a=b;
			b=b+c;
		}
		a=1;
		b=2;
	}
	for(int h=0;h<n;h++)
	{
		printf("%.3lf\n",s[h]);
	}
	return 0;
}


int main()
{
	int m;
	float sum;
	int i,j;
	int k[100];
	int Fibonacci(int);
	scanf("%d",&m);
	for(i=0;i<m;i++)
		scanf("%d",&k[i]);
	for(i=0;i<m;i++)
	{
		sum=0;
		for(j=0;j<k[i];j++)
			sum=(float)Fibonacci(j+1)/Fibonacci(j)+sum;
		printf("%.3f\n",sum);
	}
	return 0;
}
int Fibonacci(int k)
{
	int a[2]={1,2};
	int j=0;
	int i=0;
	if(k==1)
		return a[1];
	else if(k==0)
		return a[0];
	else if(k>=2)
	{
		for(i=2;i<=k;i++)
		{
			a[j]=a[j]+a[1-j];
		    j=1-j;
	    }
		   return a[1-j];
	}
}


double SUM(int n)
{
	double i=5.0,j=3.0,temp,sum=3.5;
	int k;
	for(k=3;k<=n;k++)
	{
		sum=sum+i/j;
		temp=i;
		i=i+j;
		j= temp;
	}
	return sum;
}
int main()
{
	int m,n,i;
	scanf("%d",&m);
	for(i=1;i<=m;i++)
	{
		scanf("%d",&n);
	if(n==1)
		printf("2.000\n");
	if(n==2)
		printf("3.500\n");
	if(n>=3)
		printf("%.3f\n",SUM(n));
	}
	return 0;
}


int main()
{
	int n,i,num;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d",&num);
		int j,a=1,b=2,c=3;
		double sum=0,shu;
		for(j=1;j<=num;j++){
			if(j==1) shu=(double)b/a;
			if(j==2) shu=(double)c/b;
			if(j>2){
				a=c+b,b=c,c=a;
				shu=(double)c/b;
			}
			sum+=shu;
		}
		printf("%0.3lf\n",sum);
	}
	return 0;
}


int main(){
	int m;
	scanf("%d",&m);
	int i;
	for(i=0;i<m;i++)
	{
		int n;
		scanf("%d",&n);
		int a=2,b=1,k,e;
		double sum=0;
		for(k=1;k<=n;k++)
		{
			sum+=(double)a/b;
			e=a;
			a=a+b;
			b=e;
		}
		printf("%.3lf\n",sum);
	}
	return 0;
}


double fei(int n);
int main(){
	int i,m,n;
	double result=0;
	scanf("%d",&m);
	for(i=0;i<m;i++){
		scanf("%d",&n);
		result=fei(n);
		printf("%.3lf\n",result);
	}
	return 0;
}
double fei(int n){
	double result=0;
	int a=1,b=1,k;
	for(k=1;k<=n;k++){
		int d=a;
		a+=b;
		b=d;
		result+=1.0*a/b;
	}
	return result;
}


int main(){
	int m,i,k,n;
	scanf("%d",&m);
	double *t=(double*)malloc(sizeof(double)*m);
	for(i=0;i<m;i++){
		scanf("%d",&n);
		int p=2,q=1;
		t[i]=0;
		for(k=0;k<n;k++){
			t[i]+=1.0*p/q;
			int s=p;
			p=p+q;
			q=s;
		}
	}
	for(i=0;i<m;i++){
		printf("%.3lf\n",t[i]);
	}
	free(t);
	return 0;
}


int feibonaqi(int n1);
int main()
{
	double sum = 0;
	int i, j;
	int m;
	int a[100];

	scanf("%d", &m);
	for(i = 0; i < m; i++)
	{
		scanf("%d", &a[i]);
	}
	for(i = 0; i < m; i++)
	{
		sum = 0;
		if(a[i] == 1)
		{
			sum = 2.000;
			printf("%.3lf\n", sum);
		}
		else
		{
			for(j = 1; j <= a[i]; j++)
				sum += (feibonaqi(j+1)*1.0)/feibonaqi(j);
			printf("%.3lf\n", sum);
		}
	}

	return 0;
}

int feibonaqi(int n1)
{
	int k;
	int f[100];

	f[0] = 1;
	f[1] = 2;
	for(k = 2; k < n1; k++)
	{
		f[k] = f[k-1] + f[k-2];

	}

	return f[n1-1];

}


int fbnq(int n){
    if(n==0){
    return 0;
   }
     if(n==1){
   return 1;
   }
     return fbnq(n-1)+fbnq(n-2);
  }
int main()
{
  int m,n,i,j;
  double sum;
  scanf("%d",&m);
  for(j=0;j<m;j++){
   scanf("%d",&n);
   sum=0;
   for(i=1;i<=n;i++){
    sum+=(double)fbnq(i+2)/fbnq(i+1);
   }
   printf("%.3lf\n",sum);
  }
   return 0;
}


int f(int n){
	if(n==1||n==2)
		return 1;
	else
		return f(n-1)+f(n-2);
}

int main(){
	int m,i;
	double s=0;
	scanf("%d",&m);
	for(i=0;i<m;i++){
		int a,d;
		scanf("%d",&a);
		for(d=0;d<a;d++){
			s=s+((double)f(d+3))/((double)f(d+2));
		}
		printf("%.3lf\n",s);
		s=0;
	}
	return 0;
}


int main()
{
    int n,i,j,a;

	int f2;
    float b;

    scanf("%d",&n);
    for(i=0;i<n;i++){
       scanf("%d",&a);
	   float sum=0.000;
       int f0=1;
       int f1=1;
       for(j=0;j<a;j++){
          f2=f1+f0;
          f0=f1;
          f1=f2;
          b=(float)f1/f0;
          sum+=b;
       }
	   printf("%.3f\n",sum);
    }
    return 0;
}


int main()
{
	int i,j,m,n;
	double a=2,b=1,x,fenshu=0;

	scanf("%d ",&m);
	double *p=(double *)malloc(sizeof(double)*m);

	for(j=0;;j++)
	{
		scanf(" %d",&n);
		for(i=1;;i++)
		{
			fenshu+=a/b;
			x=a+b;
			b=a;
			a=x;

			if(i==n) break;
		}
		p[j]=fenshu;
		fenshu=0;
		a=2;
		b=1;
		if(j==(m-1)) break;
	}

	for(j=0;j<m;j++)
	{
		printf("%.3lf\n",p[j]);
	}

	free(p);
	return 0;

}


int main()
{
	int m,i,j,fenzi[1000],fenmu[1000];
	scanf("%d",&m);
	int*xiangshu=(int*)malloc(sizeof(int)*m);
	double*sum=(double*)malloc(sizeof(double)*m);
	for(i=0;i<m;i++)
	{
		scanf("%d",&xiangshu[i]);
	}
	fenzi[0]=2;
	fenzi[1]=3;
	fenmu[0]=1;
	fenmu[1]=2;
	for(i=2;i<1000;i++)
	{
		fenzi[i]=fenzi[i-1]+fenzi[i-2];
	}
	for(i=2;i<1000;i++)
	{
		fenmu[i]=fenmu[i-1]+fenmu[i-2];
	}
	for(i=0;i<m;i++)
	{
		sum[i]=0;
		for(j=0;j<xiangshu[i];j++)
		{
			sum[i]+=fenzi[j]*1.0/fenmu[j];
		}
	}
	for(i=0;i<m;i++)
	{
		printf("%.3lf\n",sum[i]);
	}
	free(xiangshu);
	return 0;
}


void deal(int n)
{
     double a, b;
     a = 2.0;
     b = 1.0;
     double sum;
     sum = 0.0;
     int i;
     for(i = 0; i < n; i ++)
     {
           sum += a / b;
           double t;
           t = a;
           a = a + b;
           b = t;
     }
     printf("%.3lf\n", sum);
}
int main()
{
    int m;
    scanf("%d", &m);
    int i;
    for(i = 0; i < m; i ++)
    {
          int n;
          scanf("%d", &n);
          deal(n);
    }
    return 0;
}


double cao(int n)
{
int i;
double tmp,tt=1,ttt=2,s=0,ss=0;
for(i=1;i<=n;i++)
{ss=ttt/tt;tmp=tt;tt=ttt,ttt=ttt+tmp;
s=s+ss;}
return s;
}
int main()
{
int n,i,a[99];
double ccc;
scanf("%d",&n);
for(i=0;i<n;i++)
{scanf("%d",&a[i]);
}
for(i=0;i<n;i++)
{ccc=cao(a[i]);
printf("%.3lf\n",ccc);
}
return 0;
}


int main()
{
	int m,i=1,n,t,x;
	double s,j,r;
	scanf("%d",&m);
	while(i<=m)
	{
		scanf("%d",&n);
		for(j=1,r=2,t=1,s=0;t<=n;t++)
		{
            s=s+r/j;
			x=j+r;
			j=r;
			r=x;
		}
		printf("%.3lf\n",s);
                  i=i+1;
	}
		return 0;
	}


int main(){

int n;
scanf("%d",&n);

int i,j,k,e;
double result=0;
int a,b;
for(i=0;i<n;i++){
scanf("%d",&k);
   a=1;
   b=2;
   result=0;
    for(j=1;j<=k;j++){
		if(j==1){
		result+=1.0*b/a;
		}else{
		e=b;
		b=a+b;
		a=e;
		result+=1.0*b/a;
		}

	}

printf("%.3lf",result);

printf("\n");
}

return 0;
}


int main(){
	int i,j;
	int m,n;
	scanf("%d",&m);
    double *sum=(double*)malloc(sizeof(double)*m);
	for(i=0;i<m;i++){
		scanf("%d",&n);
		if(n==1){
			sum[i]=2.0;
		}else if(n==2){
			sum[i]=3.5;
		}else{
			double *fenmu=(double*)malloc(sizeof(double)*n);
			double *fenzi=(double*)malloc(sizeof(double)*n);
			fenmu[0]=1;
			fenmu[1]=2;
			fenzi[0]=2;
			fenzi[1]=3;
			sum[i]=3.5;
				for(j=2;j<n;j++){
				fenmu[j]=fenmu[j-1]+fenmu[j-2];
				fenzi[j]=fenzi[j-1]+fenzi[j-2];
				sum[i]=sum[i]+(fenzi[j]/fenmu[j]);
			}
			free(fenzi);
			free(fenmu);

		}
	}
	for(i=0;i<m;i++){
		printf("%.3lf\n",sum[i]);
	}

return 0;
}


int main()
{
	int m,n,a,b;
	float s;
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		a=2;b=1;s=0;
		cin>>m;
		for(int j=1;j<=m;j++)
		{
			s+=((float)a)/b;
			a+=b;
			b=a-b;
		}
		printf("%.3f\n",s);
	}
	return 0;
}


int main(int argc, char* argv[])
{
	int m,i,j,e;
	int a[100];
	float s,q,w;
	scanf("%d",&m);
	for (i=0;i<m;i++)
	{
		scanf("%d",&a[i]);
		q=2,w=1,s=0;
	    for (j=1;j<=a[i];j++)
		{
		  s+=q/w;
		  e=q;
	   	  q=q+w;
	   	  w=e;
		}
		printf("%.3f\n",s);
	}
    return 0;
}


int main(){
	int n, m, j, a, b;
	double sz[100], sum;
	scanf("%d", &n);
	for(int i=1; i<=n; i++){
		sum=0;
		a=1;
		b=2;
		scanf("%d", &m);
		for(j=0; j<m; j++){
			sz[j]=1.0*b/a;
			b=b+a;
			a=b-a;
			sum=sum+sz[j];
		}
		printf("%.3f\n", sum);
	}
	return 0;
}


int main(){
	int n,m,i,k;
	double a,b,c,e,f;
	scanf("%d\n",&m);
	for(k=0;k<m;k++)
	{
		scanf("%d\n",&n);
		a=2,b=1,c=0;
		for(i=0;i<n;i++)
		{
			c=c+a/b;
			e=a+b;
			f=a;
			a=e;
			b=f;
		}
		printf("%.3lf\n",c);
	}
	return 0;
}


int main()
{
	int a;
	int b;
	int n;
	int m;
	int t;
	double sum;
	scanf("%d", &n);
	while(n--) {
		scanf("%d",&m);
		a=2;
		b=1;
		sum=0;
		while(m--) {
			sum+=a*1.0/b;
			t=a;
			a=a+b;
			b=t;
		}
		printf("%.3lf\n", sum);
	}
	return 0;
}


int main()
{
	int m;
	scanf("%d",&m);
	for(int z=0;z<m;z++)
	{
		int n;
		scanf("%d",&n);
                  if(n==1)
                  {
                      printf("2.000\n");
                           continue;
                   }
		int a=2,b=1,c=3,d=2,c1,d1;
		float s=(float)2/1+(float)3/2;
		for(int i=2;i<n;i++)
		{
			c1=c;
			d1=d;
			c=a+c;
			d=b+d;
			a=c1;
			b=d1;
			s=s+(float)c/(float)d;
		}
		printf("%.3f\n",s);
	}
	return 0;
}


int main()
{
	int m,i,n;
	scanf("%d",&m);
	for(i=0;i<m;i++)
	{
		int j=0,a=1,b=2,d;
		float c,sum=0;
		scanf("%d",&n);
		for(j=0;j<n;j++)
		{
			c=(float)b/a;
			d=b;
			b+=a;
			a=d;
			sum+=c;
		}
			printf("%.3f\n",sum);
	}
	return 0;
}


int main() {
int i,a,b,e,m,j;
double c,d;
a=1;
b=2;
scanf("%d",&m);
int sz[m];
for(i=0;i<m;i++){
scanf("%d",&sz[i]);
}
double sum[m];
for(i=0;i<m;i++){
sum[i]=0;
}
for(j=0;j<m;j++){
a=1;
b=2;
for(i=0;i<sz[j];i++){
c=a;
d=b;
sum[j]+=(double)d/c;
e=a;
a=b;
b=e+b;
}
}
for(i=0;i<m;i++){
printf("%.3lf\n",sum[i]);
}
return 0;
}


int main()
{
	int m,n;
	double shang[100],sum=0;
	int fenzi[100],fenmu[100];
	int i,j;
	scanf("%d",&m);
	for(i=1;i<=m;i++)
	{
		fenzi[0]=2;
		fenmu[0]=1;
		scanf("%d",&n);
		for(j=0;j<n;j++)
		{
			if(j==0)
			{
				fenzi[0]=2;
				fenmu[0]=1;
				sum=2;
			}
			else
			{
				fenzi[j]=fenzi[j-1]+fenmu[j-1];
				fenmu[j]=fenzi[j-1];
				shang[j]=1.0*fenzi[j]/fenmu[j];
				sum=sum+shang[j];
			}
		}
		printf("%.3lf\n",sum);
		sum=0;
	}
	return 0;
}


int shulie(int);
int main()
{
	int n,i,j,tot;
	double sum=0;
	scanf("%d",&tot);
	for(j=0;j<tot;j++)
	{
		sum=0;
		scanf("%d",&n);
		for(i=0;i<n;i++)
		{
			sum+=(double)shulie(i+1)/shulie(i);
		}
		printf("%.3lf\n",sum);
	}
	return 0;
}
int shulie(int x)
{
	int k;
	int sl[100];
	sl[0]=1;
	sl[1]=2;
	for(k=2;k<=x;k++)
	{
		sl[k]=sl[k-1]+sl[k-2];
	}
	return sl[x];
}


int F(int n);
int main(){
int m,n;
scanf("%d",&m);
int i;
double S;
int result1,result2,j;
for(j=1;j<=m;j++){
	S=0;
	scanf("%d",&n);
	for(i=0;i<n;i++){
	   result1=F(i+2);
	   result2=F(i+3);
	   S+=(double)result2/result1;
	}
	printf("%.3lf\n",S);
}

return 0;
}
int F(int n){
int i;
int *result=(int *)malloc(sizeof(int)*n);
for(i=0;i<n;i++){
	if(i==0||i==1){
	result[i]=1;
	}
	if(i>1){
	result[i]=result[i-1]+result[i-2];
	}
}
int t;
t=result[n-1];
free(result);
return t;
}


int fbnq(int n){
	if(n == 0){
		return 0;
     }

	if(n == 1){
		return 1;
	}

	return fbnq(n-1) + fbnq(n-2);
}
int main(int argc, char* argv[])
{
	int m,i,n,j;
	double sum=0,sz[10000];
	scanf("%d",&m);
	for(i=0;i<m;i++)
	{
		scanf("%d",&n);
		for(j=0;j<n;j++)
		{
			sz[j]=1.0*fbnq(j+3)/fbnq(j+2);
			sum+=sz[j];
		}
        printf("%.3lf\n",sum);
		sum=0;

	}
	return 0;
}


void main()
{
	int m, n, i, j, p, q, t;
	float sum;
	scanf("%d", &m);
	for(i=0; i<m; i++)
	{
		scanf("%d", &n);
		sum=0;
		p=2;
		q=1;
		for(j=0; j<n; j++)
		{
			sum+=(float)p/(float)q;
			t=p;
			p=p+q;
			q=t;
		}
		printf("%.3f\n", sum);
	}
}


int main()
{
	int n;
	scanf("%d",&n);
	int geshu[128],fenzi[512],fenmu[512];
	double a[512];
	fenzi[0]=2,fenmu[0]=1;
	a[0]=(double)fenzi[0]/fenmu[0];
	fenzi[1]=3,fenmu[1]=2;
	a[1]=(double)fenzi[1]/fenmu[1];
	double sum=a[0];
	double sum1=a[0]+a[1];
	int i,j;
	for(i=0;i<n;i++)
	{
		scanf("%d",&geshu[i]);
			if(geshu[i]==1)
			{
				printf("%.3lf\n",sum);
				continue;
			}
			else if(geshu[i]==2)
			{
				sum+=a[1];
				printf("%.3lf\n",sum);
				continue;
			}
		for(j=2;j<geshu[i];j++)
		{

				a[j]=(double)(fenzi[j-2]+fenzi[j-1])/(fenmu[j-2]+fenmu[j-1]);
				fenzi[j]=fenzi[j-2]+fenzi[j-1];
				fenmu[j]=fenmu[j-2]+fenmu[j-1];
				sum1+=a[j];

		}
		if(j>=geshu[i])
		{
			printf("%.3lf\n",sum1);
			sum1=a[0]+a[1];
		}
	}
	return 0;
}


int main()
{
	int a,n,i,m,b,c;
	float sum;
	scanf("%d\n",&m);
	for(i=1;i<=m;i++)
	{
		scanf("%d\n",&n);
		sum=0;
		b=1;
		c=1;
		for(a=1;a<=n;a++)
		{
			b=b+c;
			c=b-c;
			sum=sum+(double)(b)/(double)(c);
		}
		printf("%.3f\n",sum);
	}
	return 0;
}


double f(int n){
	double a=1,b=2,c;
	int i=1;
	double d=2.000;
	if(n==1)
		return d;
    while(i<n){
		c=a+b;
		a=b;b=c;
		d+=c/a;
		i++;
	}
	return d;
}
int main(){
	int m,i,sz[100];
	double s;
	scanf("%d",&m);
	for(i=0;i<m;i++){
		scanf("%d",&(sz[i]));
	}
    for(i=0;i<m;i++){
		printf("%.3lf\n",f(sz[i]));
	}
	return 0;
}


int fab(int n)
{
    if(n>=2)
        return (fab(n-1)+fab(n-2));
    else if(n==1)
        return 1;
    else if(n==0)
        return 1;
}

int main()
{
    int m,n,i,j;
    float sum[100]={0};
    scanf("%d",&m);
    for(i=0;i<m;i++)
    {
        scanf("%d",&n);
        for(j=0;j<n;j++)
        {
            sum[i]=sum[i]+(float)fab(j+2)/(float)fab(j+1);
        }
    }
    for(i=0;i<m;i++)
        printf("%.3f\n",sum[i]);
    return 0;
}


int main(){
	int m,n,e;
	scanf("%d",&m);
	double*za=(double*)malloc(sizeof(double)*m);

	for(int i=0;i<m;i++){
		scanf("%d",&n);
		int a=2,b=1;
		za[i]=0;
		for(int k=0;k<n;k++){
			za[i]+=1.0*a/b;
			e=a;
			a=a+b;
			b=e;

		}
	}
	for(int h=0;h<m;h++){
		printf("%.3lf\n",za[h]);
	}
	free(za);
	return 0;
}


double cal(int n)
{int i,a=1,b=2,temp;
double sum=0;
for(i=0;i<n;i++)
{sum=sum+(double)b/(double)a;
temp=a+b;
a=b;
b=temp;}
return sum;}
int main()
{int m,i,n[1000];
scanf("%d",&m);
for(i=0;i<m;i++)
{scanf("%d",&n[i]);
printf("%.3f\n",cal(n[i]));}}


int main(){
 int m,n,i,k,a,b;
 double x,sum;
  scanf("%d ",&m);
  for(k=0;k<m;k++){
     scanf("%d ",&n);
    for(i=0,a=2,b=1;i<n;i++,a=a+b,b=a-b){
        x=(double)a/b;
        sum+=x;
    }
     printf("%.3lf\n",sum);
     sum=0;
  }

   return 0;
}


float a(int x)
{
	if(x==1)
	    return 2;
	else if(x==2)
		return 3;
	else
		return a(x-1)+a(x-2);
}
float b(int y)
{
	if(y==1)
		return 1;
	else if(y==2)
		return 2;
	else
		return b(y-1)+b(y-2);
}
int main()
{
	int m,n,i,j;
	float sum;
	scanf("%d",&m);
	for(i=0;i<m;i++)
	{
		sum=0;
		scanf("%d",&n);
		for(j=1;j<1+n;j++)
		{
			sum+=a(j)/b(j);
		}
		printf("%.3f\n",sum);
	}
	return 0;
}


double f(int x)
{
	double s;
	if(x==1) s=1.0;
	else if(x==2) s=2.0;
	else s=f(x-1)+f(x-2);
	return s;
}
int main()
{
	int n,a[1000];
	int i,j,k,l;
	double sum;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d",&a[i]);
		sum=0;
		for(j=1;j<=a[i];j++)
		{
			sum=sum+f(j+1)/f(j);
		}
		printf("%.3lf\n",sum);
	}
	scanf("%d",&i);
	return 0;
}


int fbnq(int x);
int main(){
    int n,i,k,sz[100];
	double result;
    scanf("%d",&n);
	for(i=0;i<n;i++){
	    scanf("%d",&(sz[i]));
        result=0;
		for(k=0;k<sz[i];k++){
		    result+=fbnq(k+1)*1.0/fbnq(k);
		}
		printf("%.3lf\n",result);
	}

	return 0;
}
int fbnq(int x){
	if(x==0){
	   return 1;
	}
     if(x==1){
	   return 2;
	}
	 return fbnq(x-1)+fbnq(x-2);
}


int main(){
  int n,m;

  int i,j;

scanf("%d",&n);
for(i=0;i<n;i++){
   scanf("%d",&m);
  int a=2,b=1;
  double sum=0;
   for(j=m;j>0;j--){
     sum+=1.0*a/b;
	 a=a+b;
	 b=a-b;
   }
   printf("%.3lf\n",sum);
}

return 0;

}


int main()
{
	int i,n,p;
	scanf("%d",&n);
	p=0;
	for(i=1;i<=n;i++)
	{
		if(i%7==0)
	     continue;
	    else
			switch(i)
		{
			case 7 :
			case 17:
			case 27:
			case 37:
			case 47:
			case 57:
			case 67:
			case 70:
		    case 71:
			case 72:
			case 73:
			case 74:
			case 75:
			case 76:
			case 77:
			case 78:
			case 79:
		    case 87:
			case 97:
			  continue;
			default:
				p=i*i+p;
		}
	}
	printf("%d",p);
		return 0;
}


int main()
{
	int sum,i,e,n;
	sum=0;

	scanf("%d",&e);

	for(i=1;i<=e;i++){

		int a;
		a=i;
		if(a%7==0){
			n=1;
		}
		else{
			int b,c,d;
			d=a;
			do{
				c=d;
				b=c%10;
				if(b==7){
					break;
				}
				else{
					d=(c-b)/10;
				}
			}
			while(b!=0);
			if(b==7){
				n=1;
			}
			else{
			n=0;
			}
		}

		if(n==0){
			sum+=i*i;
		}
		else{
			continue;
		}
	}
	printf("%d\n",sum);
	return 0;
}


int main(int argc, char* argv[])
{

	int sum=0;
	int m,i,n;

	scanf("%d",&n);

	for(i=n;i>=1;i--){
		m=i/10;
			if(i%7==0)
				continue;
			if(i%10==7)
				continue;
			if(m%10==7)
				continue;
			if(m%10!=7||i%10!=7||i%7!=0)
				sum+=i*i;
	}

		printf("%d",sum);
		return 0;
}


int main()
{
   int sum=0;
   int n,i;
   scanf("%d",&n);
   for(i=1;i<=n;i++)
   {
       if(i%7==0) continue;
       else if((i-10*(int)(i/10))==7)  continue;
       else if((int)(i/10)==7) continue;
       sum=sum+i*i;
    }
    printf("%d",sum);
    return 0;
}


	int wuSeven(int a){
		if(a%7==0){
			return 0;
		}
		for(int num=a;num>0;num=num/10){
			if(num%10==7){
				return 0;
			}
		}
		return 1;
	}

int main(){
    int n;
	int sum=0;
	scanf("%d",&n);
	for(int i=1;i<=n;i++){
		if(wuSeven(i)){
			sum=sum+i*i;
	}
	}
	printf("%d",sum);
	return 0;
}


int main()
{
int a,b,n,x,sum=0;
scanf("%d",&n);
for (a=0;a<=9;a++)
{
if (a==7) continue;
for (b=0;b<=9;b++)
{
if (b==7) continue;
x=a*10+b;
if (x%7==0) continue;
if (x>n) break;
sum+=x*x;
}
}
printf("%d\n",sum);
return 0;
}


int main()
{
 int n;
 int result=0;
 scanf("%d",&n);
 for (int i=1;i<= n;i++){
	 if (i%7!=0) {
      for (int k=i;k>0;k/=10){
          if (k%10==7) break;
          if(k/10==0){
             result+=i*i;
		  }
	  }
	 }
 }
 printf("%d",result);
 return 0;
}


int cor(int x);

int main()
{
	int n;
	scanf("%d",&n);
	int sum = 0;
	int i;
	for ( i = 0 ; i <= n ; i++ )
	{
		if ( cor(i) == 1 )
		{
			//printf("%d\n",i);
			sum += i*i ;
		}
	}
	printf("%d\n",sum);
	return 0;
}

int cor ( int x )
{
	if ( x % 7 == 0 )
	{
		return 0;
	}
	int i = 10;
	do
	{
		if ( x % i == 7 )
		{
			return 0;
		}
		else
		{
			x = x / i;
		}
		i *= i;
	}while ( x != 0 );
	return 1;
}


main()
{
	int n,i,m,r,sum=0;
	scanf("%d",&n);
	for(i=1;i<=n;i++)
	{
		if(i%7==0)
			continue;
		else{
			m=i;
			while(m!=0)
			{
				r=m%10;
				m=m/10;
				if(r==7) break;
			}
			if(m!=0||r==7) continue;
			else{//printf("i=%d\n",i);
			sum=sum+i*i;}
		}
	}
	printf("%d\n",sum);
}


int with7(int x)
{
    if(x%7==0)  return 1;
    while(x>0)
    {
              if(x%10==7) return 1;
              x=x/10;
    }
    return 0;
}

int main()
{
    int n;
    cin>>n;
    int sum=0;
    for(int i=1;i<=n;i++)
        if(!with7(i))
            sum+=(i*i);
    cout<<sum<<endl;
    return 0;
}


void main(){
	int n;
	int sum,i,a,b;
	scanf("%d",&n);
	sum=0;
	for(i=1;i<=n;i++){
		a=i/10;
		b=i%10;
		if(i%7==0 || a==7 || b==7)
			continue;
		sum=sum+i*i;
	}
	printf("%d\n",sum);
}


int main(int argc, char* argv[])
{
	int n,i,sum;
	sum=0;
	scanf("%d",&n);
	for(i=1;i<=n;i++)
		if (i%7!=0&&(int)i%10!=7&&(int)i/10!=7){
			sum+=i*i;
		}
	printf("%d",sum);
	return 0;
}


int main(){
    int sum=0;
    int n;
    scanf("%d",&n);
    for(int num=1;num<=n;num++)
    {

            if(num%7==0||(num-70<=9&&num-70>0)||num%10==7)
            {
                continue;
            }
            sum+=num*num;

    }
    printf("%d",sum);
    getchar();getchar();
    return 0;
}


int main()
{
	int n;
	scanf("%d",&n);
	int i;
	unsigned long sum=0;
	for(i=1;i<=n;i++)
	{
		sum=sum+i*i;
	}
	if(n<7)
	{
		sum=sum;
	}
	if(n>=7)
	{
		sum=sum-7*7;
	for(i=8;i<=n;i++)
	{
		if(i%7==0||(i-7)%10==0||i/10==7)
		{
			sum=sum-i*i;
		}
		else
		{
			continue;
		}
	}
	}
	printf("%ld",sum);
	return 0;
}


int main()
{
	int n,sum=0,number;
	cin>>n;
	for(int i=0;i<=n;i++)
	{
		number=i;
		if(number<=10)
		{
		   if(number!=7)
		       sum+=number*number;
		}
		else
		{
			if((number%7!=0)&&(number/10!=7)&&(number%10!=7))
               sum+=number*number;
		}
	}
	cout<<sum<<endl;
	return 0;
}


int ref(int num);

int main()
{
	int n,i,sum=0;

	scanf("%d",&n);

	for(i=1;i<=n;i++)
		sum+=ref(i)*ref(i);

	printf("%d",sum);

	return 0;
}

int ref(int num)
{
	if((num%10==7)||(num/10==7)||(num%7==0))
		return 0;
	return num;
}


int main ()
{
	int n,l,yushu,k,s=0;
	cin>>n;
	for (int i=1; i<=n; i++)
	{
		if (i%7==0)
			continue;
		else
		    k=i;
                while ( k!=0)
                {
                    yushu=k%10;
                    if (yushu==7)
                    break;
                    else
                    k=(int)k/10;
                }
        if ( k>=0&&k<=9&&yushu!=7)
        s=s+i*i;
        else
        s=s;
    }
	cout<<s;
return 0;
}


int main(int argc, char* argv[])
{
	int n;
	int t,i,sum=0;
	scanf("%d",&n);
	for(i=1;i<=n;i++)
	{
		if(i%7==0) continue;
		else if((i-7)%10==0) continue;
		else if (i-70<=9&&i-70>=0) continue;
    	else t=i;
        sum+=t*t;
	}
	printf("%d\n",sum);
	return 0;
}


int main()
{
	int n,i,sum;
	sum=0;
	scanf("%d",&n);
	for(i=1;i<=n;i++)
	{
		if(i%7==0) sum=sum+0;
		else if(i%10==7) sum=sum+0;
		else if((i-i%10)/10==7) sum=sum+0;
		else sum=sum+i*i;
	}
	printf("%d\n",sum);
	return 0;
}


int main(void)
{
	int n,sum=0;
	cin >>n;
	for(int i=1;i<=n;i++)
	{
		if (i%7==0) continue;
		else if ((i-7)%10==0) continue;
		else if (i>69&&i<80) continue;
		else sum+=i*i;
	}
	cout <<sum;
}


int main()
{double n,t,p,q,r,o,s;
cin>>n;
t=0;
s=0;
while(t<n)
{t=t+1;
p=fmod(t,7);
q=fmod(t,10);
o=t/10;
r=floor(o);

if (p==0||q==7||r==7)
s=s;
else s=s+t*t;}
cout<<s;
return 0;
}


int main()
{
	int n;
	cin>>n;
	int sum=0;
	for(int i=1;i<=n;i++)
	{
		if(i%10==7||i>69&&i<80||i%7==0)
			continue;
		else
			sum+=i*i;
	}
	printf("%d\n",sum);
	return 0;
}


int main(){
	int n,i,s,a;
 s=0;
 scanf("%d",&n);
for(i=1;i<=n;i++)
{
		a=(i-i%10)/10;
	if(i%7==0)
      continue;
	else if(i%10==7){
	continue;

	}
	else if(a==7){
		continue;
	}
	s=s+i*i;
}
   printf("%d",s);
    return 0;
}


int xiangguan(int n)
{if(n%7==0)
 return(0);
 else if(n%10==7||n/10==7)
 return(0);
 else return(1);
}

int main()
{int n;
 scanf("%d",&n);
 int i,sum=0;
 for(i=1;i<=n;i++)
 if(xiangguan(i))
 sum+=i*i;
 printf("%d",sum);
}


int main()
{
	int n, sum = 0, i;
	cin >> n;
	for(i = 1; i <= n; i++)
	{
		if(i % 7 == 0 )

		continue;

		else
			if(i % 10 == 7)

			continue;

			else
				if(i / 10 == 7)

				continue;

		sum = sum +i*i;
	}
	cout << sum << endl;
	return 0;
}


int yuqiwuguan(int);
int main()
{
	int n;
	int sum=0;
	scanf("%d",&n);
	for(int i=0;i<=n;i++)
	{
		if(yuqiwuguan(i))
		{
			sum+=i*i;
		}
	}
	printf("%d",sum);
	return 0;
}
int yuqiwuguan(int i)
{
	int r;
	if(i%7==0||i%10==7||i/10==7)
	{
		r=0;
	}
	else
	{
		r=1;
	}
	return r;
}


int main()
{
    int s=0,n,i,a;
	scanf("%d",&n);
	for(i=1;i<=n;i++)
		if(i%u!=0)
		{
		  a=i;
		  while(a>0)
		  {
			if(a%g==u)
			  break;
			a=a/g;
		  }
		  if(a==0)
			s+=i*i;
		}
		printf("%d",s);
	return 0;
}


int main()
{
	int n;
	int a=0;
	int i=1;
	scanf("%d",&n);
	for (i=1; i<=n; i++)
	{
		if (i%7==0)
		{
			continue;
		}
	    if((i-7)%10==0)
		{
			continue;
		}
		if(i/10==7)
		{
			continue;
		}
			a=a+i*i;
	}
	printf("%d", a);
	return 0;
}


int main()
{
	int num,i,flag,t,ans;
	cin>>num;
	ans=0;
	for (i=1;i<=num;i++)
	{
		flag=0;
		if (i%7==0) flag=1;
		else
		{
			t=i;
			while (t>=1)
			{
				if (t%10==7) flag=1;
				t=t/10;
			}
		}
		if (flag==0) ans=ans+i*i;
	}
	cout<<ans;
	return 0;
}


int has7(int a);
int has7(int a)
{
	int len,b,p,k;
	k=0;
	len=0;
	b=a;
	do{
		b=b/10;
		len++;
	}while (b>0);
	for (int i=len-1;i>=0;i--)
	{
		p = (int)(a/pow(10,i));
		if (p==7)
		{
			k=1;
			break;
		}
		a = a - p*(int)pow(10,i);
	}
	return k;
}

int main()
{
	int n,m;
	int s=0;
	scanf("%d",&n);
	for(m=1;m<=n;m++)
	{
		if(m%7!=0 && has7(m)==0)
		{
			s = s + m*m;
		}
	}
	printf("%d",s);
	return 0;
}


int seven(int x){
	if(x%7==0){
		return 1;
	}
	if(x%10==7){
		return 1;
	}
	if(x-x%10==70){
		return 1;
	}
	return 0;
}
int main(){
	int n,i,sum=0;
	scanf("%d",&n);
	for(i=1;i<=n;i++){
		if(seven(i)==0)
			sum+=i*i;
	}
	printf("%d",sum);
	return 0;
}


int main()
{
    int n, i, hash[100], sum=0;
    cin>>n;
    for(i=1; i<=n; i++)
      {
        hash[i]=1;
        if(i>=70 && i<=79)
          hash[i]=0;
        else if(i%10==7)
          hash[i]=0;
        else if(i%7==0)
          hash[i]=0;
      }
    for(i=1; i<=n; i++)
      {
        if(hash[i]==1)
        sum=sum+i*i;
      }
    cout<<sum;
    int a;cin>>a;
    return 0;

    }


int main()
{
	int n,a=0,m;
	scanf ("%d",&n);
	while (n>0)
	{
		if (n%7==0)
		{n--;continue;}
		if (n%10==7)
		{n--;continue;}
		else
		{m=n/10;}
		if (m%10==7)
		{n--;continue;}
		else
		{a=n*n+a;n--;}
	}
	printf("%d\n",a);
	return 0;
}


int main()
   {
     int n,fh,a,b,sum;
     cin >>n;
     sum=0;
     for (int i=1;i<=n;i++)
       {
         a=i;
         fh=1;
         if (a%7==0)  fh=0;
          do
            {
               b=a % 10;
               a=a / 10;
               if (b==7) fh=0;
             }
          while (a>0);
         sum=sum+i*i*fh;
       }
      cout <<sum;
    return 0;
  }


int yu7wuguan(int num);
int main(){
	int i,num;
	int result=0;
	scanf("%d",&num);
	for(i=1;i<=num;i++){
		if(yu7wuguan(i)){
           result+=i*i;
		}
          }
		printf("%d",result);
			 return 0;
}
	int yu7wuguan(int num){
		if(num%7==0||num/10==7||num%10==7){
			return 0;
		}
		return 1;

	}


int main()
{
	int n,i,x,sum;
	int panduan(int);
	int jisuan(int);
	scanf("%d",&n);
	sum=0;
	for(i=1;i<=n;i++)
	{
		x=panduan(i);
		if(x==1)
		{
			sum=sum+jisuan(i);
		}
	}
	printf("%d\n",sum);
    return 0;
}
int panduan(int y)
{
	int z;
	if(y%7==0)
	{
		return 0;
	}
	else
	{
		for(; ;)
		{
			z=y-10*(int)(y/10);
			if(z==7)
			{
				return 0;
			}
			y=(int)(y/10);
			if(y==0)
			{
				return 1;
			}
		}
	}
}
int jisuan(int y)
{
	int z;
	z=y*y;
	return(z);
}


int f(int a)
{
	if(a%7==0)
		return 0;
	else if(a>10 && a%10!=0 && (a%10)%7==0)
		return 0;
	else if(a>=70 && a<=79)
		return 0;
	else
		return 1;
}

int main()
{
	int n,i;
	long sum=0;
	scanf("%d",&n);
	for(i=1;i<=n;i++)
	{
		if(f(i))
			sum=sum+i*i;
	}
	printf("%d\n",sum);
	return 0;
}


int main(int argc, char *argv[])
{
  int n,i,j,t,sum=0,flag=0;

  scanf("%d",&n);
  for(i=1;i<=n;i++)
    {
      t=i;
     for(j=1;j<=2;j++)
        {
         if(i%10==7)
           {
             flag=1;
             break;
            }
          else
           i=i/10;
       }
       i=t;
      if(i%7!=0 && flag!=1)
        {
          sum=sum+i*i;
        }
      flag=0;
    }
  printf("%d",sum);

  return 0;
}


int seven(int n)
{
    int s=1,b;
    int a[3];
    b=n-n/7*7;
    if(b==0) s=0;
    for(int i=0;i<=2;i++)
    {
            a[i]=n-n/10*10;
            n=n/10;
            if(a[i]==7) s=0;
            }
    return s;
}
int main()
{
    int x,sum=0;
    cin>>x;
    for(int i=1;i<=x;i++)
    {
               sum=sum+i*i*seven(i);
               }
    cout<<sum;
    return 0;
}


int seven(int a)
{
    int mod;
    if (a%7==0)return 1;
    while(a>0)
    {mod=a%10;
    if(mod==7)return 1;
    a/=10;}
    return 0;
}
int main()
{
    int n,i;
    int sum=0;
    scanf("%d",&n);
    for (i=1;i<=n;i++)
    if(seven(i)!=1)sum=sum+i*i;
    PD(sum);
    return 0;
}


int main()
{
	int if_k_is(int);
	int n;
	cin>>n;
	int sum=0;
	for(int k=1;k<=n;k++)
	{
		if(if_k_is(k))
			sum+=k*k;
	}
	cout<<sum<<endl;
	return 0;
}

int if_k_is(int k)
{
	if(k%7==0)
		return 0;
	while(k!=0)
	{
		if(k%10==7)
			return 0;
		k=k/10;
	}
	return 1;
}


int yu7wuguan(int number);
int main()
{
int num,result=0;
scanf("%d",&num);
for(int i=1;i<=num;i++){
if(yu7wuguan(i)){
result+=i*i;}
}
printf("%d",result);
return 0;
}
int yu7wuguan(int number){
if(number%7==0){
return 0;
}
if(number%10==7||number/10==7){return 0;}
return 1;
}


int N, Sum = 0;

int main()
{
	int i, f, x;
	scanf ("%d", &N);
	for (i = 1; i <= N; i ++)
	{
		if (i % 7 == 0) continue;
		x = i; f = 1;
		while (x > 0 && f)
		{
			if (x % 10 == 7) f = 0;
			x /= 10;
		}
		if (!f) continue;
		Sum += i * i;
	}
	printf ("%d\n", Sum);

	return 0;
}


int yu7wuguan(int e);

int main(){
	int n;
	scanf("%d",&n);
	int i,result;
	result=0;
	for(i=1;i<=n;i++){
		if(yu7wuguan(i)){
				result+=i*i;
		}
	}

	printf("%d",result);

	return 0;
}

int yu7wuguan(int e){
	if(e%7==0){
		return 0;
	}
	while(e/10>=0&&e>0){
		int i;
		i=e%10;
		if(i==7){
			return 0;
		}
		e/=10;
	}
	return 1;
}


int main(int argc, char* argv[])
{
	int n,i,sum,c;n>1&&n<100;
	sum=0;
	scanf("%d",&n);
i=0;
	while(i<n)
	{
		i++;
		c=i/10;
		if(i%7==0||i/10==7||i-c*10==7)
		{
			continue;

		}
		sum=sum+i*i;
	}
	printf("%d\n",sum);
	return 0;
}


int main()
{
    int n,i,sum=0,shi,ge;
    cin>>n;
    shi=n/10;ge=n-10*shi;
    for(i=1;i<=n;i++)
    {
     shi=i/10;ge=i-10*shi;
     if(i%7!=0&&shi!=7&&ge!=7)
     sum=sum+i*i;
    }
    cout<<sum;
    return 0;
}


int t;
int fun(int n)
{
int x;
if (n % 7 == 0) return 0;
while (n >= 10){
x= n - n/10*10;
if (x == 7) return 0;
n=n/10;
}
if (n % 7 == 0) return 0;
return 1;
}

int main()
{
 int n;
 int i,s = 0;
 scanf("%d",&n);
 for (i = 1;i <= n;++i)
 {
// printf("i=%d %d\n",i,fun(i));
s = s + i*i*fun(i);
 }
 printf("%d",s);
 return 0;
}


int main ()
{
   int n,i,k=0;
   double a[100];
   cin>>n;
   for(i=1;i<=n;i++)
   {
    a[i]=i;
	if(i%7==0)
	{
	 a[i]=0;
	 continue;
	}
	else if(i%10==7)
	{
	 a[i]=0;
	 continue;
	}
	else if(i<=79&&i>=70)
	{
	 a[i]=0;
	 continue;
	}
   }
   for(i=1;i<=n;i++)

    k=k+pow(a[i],2);
   (int)k;
   cout<<k<<endl;
   return 0;
}


int main()
{
    int i, n, sum, sum1;

	sum = sum1 = 0;

	cin >> n;

	for ( i = 1; i <= n; i++)
	{
		if ( i % 7 == 0 || i % 10 == 7 || i / 10 == 7)

			sum = sum + i * i;

		else

			sum = sum;

		sum1 = sum1 + i * i;
	}

		sum = sum1 - sum;

		cout << sum << endl;

		return 0;
}


int judge(int num)
{
	if(num%7==0) return 0;
	while(num>0)
	{
		if((num-7)%10==0) return 0;
		num/=10;
	}
	return 1;
}
void main()
{
    int i,num,sum=0;
	scanf("%d",&num);
	for(i=1;i<=num;i++)
		if(judge(i)==1) sum+=i*i;
	printf("%d\n",sum);
}


int main()
{ int leap(int n);
int n,sum=0,i;
scanf("%d",&n);
for(i=1;i<=n;i++)
{ if(i%7!=0&&leap(i)) sum=sum+i*i;}
printf("%d\n",sum);
return 0;
}
int leap(int n)
{ int a,b,w;
a=n/10;
b=n%10;
if(a!=7&&b!=7) w=1;
if(a==7||b==7) w=0;
return w;
}


int main()
{
	int a, n ,sum=0;
	 scanf("%d",&a);
	 for(n=1;n<=a;n++)
	 {
		 if(n%7==0)
			 sum=sum;

		 else if(n%10==7)
			 sum=sum;

		 else if (n%10!=7&&(n/10)%10==7)
			 sum=sum;
		 else
			 sum += n*n;
     }
	printf("%d",sum);
	return 0;
}


int main()
{
	int m,n,sum;
	sum=0;
	scanf("%d", &n);
	for(m=0;m<=n;m++)
	{
		switch(m)
		{
case 7:
break;
case 14:
break;
case 17:
break;
case 21:
break;
case 27:
break;
case 28:
break;
case 35:
break;
case 37:
break;
case 42:
break;
case 47:
break;
case 49:
break;
case 56:
break;
case 57:
break;
case 63:
break;
case 70:
break;
case 67:
break;
case 71:
break;
case 72:
break;
case 73:
break;
case 74:
break;
case 75:
break;
case 76:
break;
case 77:
break;
case 78:
break;
case 79:
break;
case 84:
break;
case 87:
break;
case 91:
break;
case 97:
break;
case 98:
break;
default:
sum+=m*m;
break;
		}
	}
	printf("%d", sum);
		return 0;
}


int main()
{
    int sum, flag, n;
    while(cin >> n)
    {
        sum = 0;
        for(int i = 1; i <= n; i++)
        {
            flag = 0;
            if(i%7 == 0) continue;
            int tmp = i;
            while(tmp != 0)
            {
                if(tmp%10 == 7) flag = 1;
                tmp = tmp/10;
            }
            if(flag == 1) continue;
            sum = sum + i*i;
        }
        cout << sum << endl;
    }
    return 0;
}


int main ()
{
	int n, x, y, sum;
	cin >> n;
	x = 1;
	sum = 0;
	do
	{
		y = x % 7;
		if ( y == 0 ) x = x + 1;
		else
		{
			y = x % 10;
			if ( y == 7 ) x = x + 1;
			else
			{
				y = x / 10;
				if ( y == 7 ) x = x + 1;
				else
					sum = sum + x * x;
					x = x + 1;
			}
		}
	}
	while ( x <= n );
	cout << sum;
	return 0;
}


int main(int argc, char* argv[])
{
	int a,b,sum=0;
	scanf("%d",&b);
	for(a=1;a<=b;a++){
		if(a%7==0)continue;
		if(a%10==7)continue;
		if(a-a%10==70)continue;
		sum+=a*a;
	}
	printf("%d\n",sum);
	return 0;
}


int main(int argc, char *argv[])
{
    int n, i ,sum=0;
    cin>>n;
    for (i=1 ;i <= n;i ++)
    {
    if ((i%7) == 0)
		;
    else
	{if ((i/10 ==7) || ((i %10) ==7))
	;
           else
           {sum= sum +i*i;}
           }
      }
cout<<sum<<endl;

    return EXIT_SUCCESS;
}


int main()
{
	int n;
	cin >> n;
	int num = 1, sum = 0;
	int a, b;
	while (num <= n)
	{
		if (num % 7 == 0)
			num += 1;
		else
		{
			a = num / 10;
			b = num - a * 10;
			if ((a == 7) || (b == 7))
				num += 1;
			else
				{
					sum = sum + num * num;
					num += 1;
				}
		}
	}
	cout << sum << endl;
	return 0;
}


int pd(int i)
{
	if(i%7==0) return 0;
	while(i!=0)
	{
		if(i%10==7) return 0;
		i/=10;
	}
	return 1;
}
int main()
{
	int i,j,n,sum=0;
	cin>>n;
	for(i=1;i<=n;i++)
	{
		if(pd(i))
		sum+=i*i;
	}
	cout<<sum<<endl;
	return 0;
}


int work(int n)
{
	int i,j,k=n;
	if(n%7==0)return 0;
	while(n>=1)
	{
		if(n%10==7)return 0;
		n/=10;
	}
	return k*k;
}
int main()
{
int a[101];
int i,j,sum=0,n;
cin>>n;
for(i=1;i<=n;i++)
sum+=work(i);
cout<<sum;
	return 0;
}


int main()
{
	int i,n,sum=0,c,d;
	scanf("%d",&n);
	for(i=1;i<=n;i++){
	    c=i%10;
		d=i/10;
		if(i%7==0)continue;
		if(d==7)continue;
		if(c==7)continue;
		sum+=i*i;
	}
		printf("%d",sum);
	return 0;
}


int main()
{
	int Sum = 0, N;
	cin >> N;
	for (int I = 1; I <= N; I++)
	{
		int K = I,Flag = 0;
		while (K)
		{
			if (K % 10 == 7) Flag = 1;
			K = K / 10;
		}
		if (I % 7 == 0) Flag = 1;
		if (!Flag) Sum += I*I;
	}
	cout << Sum <<endl;
	return 0;
}


    int yu7WuGuan(int);

    int main(){
         int num, i, result = 0;
         scanf("%d", &num);
         for(i = 1; i <= num; i++) {
               if(yu7WuGuan(i)) {
               result += i*i;
               }
         }
               printf("%d", result);
               return 0;
               }
         int yu7WuGuan(int number){
         int num;
         if(number%7 == 0) {
                     return 0;
         }
         for(num = number; num > 0; num /= 10) {
         if (num%10 == 7) {
                     return 0;
                     }
         }
         return 1;
    }


int main(int argc, char* argv[])
{
	int n,sum,i,s,g;
	scanf("%d",&n);
	sum=0;
	for (i=1;i<=n;i++)
	{
		if (i%7!=0)
		{
			g=i%10;
			s=i/10;
			if (g!=7 && s!=7)
			{
				sum = sum + i*i;
			}
		}
	}
	printf("%d",sum);
	return 0;
}


int main()
{
	int i,n,sum=0,mod,judge;
	cin>>n;
	for(n;n>0;n--)
	{
		if(n%7==0||n%10==7||(n/10)==7)
		   continue;
		sum+=n*n;
	}
	cout<<sum<<endl;
	return 0;
}


int main(int argc, char* argv[])
{
	int m;
	int sum=0;
	int i;
	scanf("%d",&m);

	for(i=1;i<=m;i++)
	{
		if(i%10==7||i/10==7||i%7==0)
			sum+=i*i;
	}

	int SUM=0;
	int n;
	for(n=0;n<=m;n++)
	{
		SUM+=n*n;
	}
	printf("%d",SUM-sum);
	return 0;

}


int main()
{
	int n, i, k;
	int sum=0;
	scanf("%d",&n);
	for(i=1;i<=n;i++)
	{
		if(i%7==0) continue;
		else
		{
			for(k=i;k>0;k/=10)
			{
				if(k%10==7) break;
			}
	        if(k==0) sum+=i*i;
		}
	}
	printf("%d",sum);
	return 0;
}


int yu7wuguan(int i);
int main() {
    int n,i,x;
	int s=0;
	scanf("%d",&n);
	for(i=1;i<=n;i++){
		if(yu7wuguan(i)){
			s+=i*i;
		}
	}
	printf("%d",s);
	return 0;
}
int yu7wuguan(int num){
	if(num%7==0){
		return 0;
	}
	for(int n=num;n>0;n/=10){
		if(n%10==7){
			return 0;
		}
	}
	return 1;
}


int main()
{
    int n, i, m;
    m = 0;
    scanf("%d", &n);
    for(i=1;i<=n;i++)
    {
            if(i==17) m = m;
            else if(i==27) m = m;
            else if(i==37) m = m;
            else if(i==47) m = m;
            else if(i==57) m = m;
            else if(i==67) m = m;
            else if(i>=71&&i<77) m = m;
            else if(i>=78&&i<80) m = m;
            else if(i==87) m = m;
            else if(i==97) m = m;
			else if(i%7==0) m = m;
            else m = m + i * i;
    }
    printf("%d", m);
    return 0;
}


int nseven(int n)
{
	if(n%7==0) return 0;
	while(n/10!=0)
		{if(n%10==7) return 0;n=n/10;}
	if(n%10==7) return 0;
	else return 1;
}

int main()
{
	int n,i,sum=0;
	scanf("%d",&n);
	for(i=1;i<=n;i++)
		if(nseven(i)) sum+=i*i;
	printf("%d\n",sum);
	return 0;
}


int main()
{
int n,sum=0;
double s1,s2,i;
cin>>n;
for (i=0.0;i<=n;i++)
{
	s1=floor(i/100);
	s2=floor((i-s1*100)/10);
if(i/7==floor(i/7))
	continue;

else if (s1==7||s2==7||i-s1*100-s2*10==7)
	continue;
sum+=i*i;

}
cout<<sum<<endl;
return 0;

}


int main()
{
    int n;
	int sum=0;
	scanf("%d",&n);
	while(n>0)
	{
	if(n<100)
		if(n%7!=0)
			if(n/10!=7)
				if(n%10!=7)
		sum=sum+n*n;
		n--;
	}
	printf("%d",sum);
	return 0;
}


int main()
{
	int n=0,i=0,sum=0;
	cin>>n;
    for(i=1;i<=n;i++)
	{
		if(i%7==0)
			sum=sum;
		else if(i/10==7)
		    sum=sum;
		else if(i-i/10*10==7)
			sum=sum;
		else
			sum=sum+i*i;
	}
	cout<<sum<<endl;
	return 0;
}


void main()
{
int a,ss=0,i;
scanf("%d",&a);
for(i=1;i<=a;i++)
   {if(i%7==0) ss=ss;
    else if(i>=70&&i<80) ss=ss;
	else if(i%10==7) ss=ss;
	else ss=ss+i*i;
	}
printf("%d\n",ss);
}


int main()
{
	int n;
	scanf("%d",&n);
	int i=1;
	int sum=0;
	for(i=1;i<=n;i++)
	{
		if(i%7==0)
		{
		}
		else if(i%10==7)
		{
		}
		else if((i/10)%10==7)
		{
		}
		else
		{
			sum=sum+i*i;
		}
	}
	printf("%d",sum);
	return 0;
}


int unrelatedNumber(int num, int sum)
{
     if (num == 0)
    {
              return sum;
    }
    if (num % 7 == 0 || num % 10 == 7 || num / 10 == 7)
    {
              return  unrelatedNumber(num - 1, sum);
    }
    return  unrelatedNumber(num - 1, sum + num * num);
}

int main(int argc, char ** argv)
{
    int num, sum = 0;
    scanf("%d", &num);
    if (num >= n || num <= 0)
    {
              printf("Input a illegal number.\n");
              return -1;
    }
    printf("%d", unrelatedNumber(num, sum));
    return 0;
}


int main()
{
 int n,i;
 cin>>n;
 float a,b,c,d,e,s=0;
 for(i=1;i<=n;i++)
 {
  a=i%7;
  if(a==0)s=s+0;
  else{ b=i%10;
        c=b/7;

        if(c==1)s=s+0;
        else{d=i-b;
             e=d/70;

             if(e==1)s=s+0;
             else s=s+i*i;
             }
      }
  }

 cout<<s<<endl;
 getchar();
 getchar();
 return 0;
 }


int main()
{
	int n,i,a,b;
	long int sum=0;
	cin>>n;
	for(i=1;i<=n;i++)
	{
	a=i/10;
	b=i%10;
	if(a!=7&&i%7!=0&&b!=7)
		sum=sum+i*i;
	}
	cout<<sum;
	return 0;
}


int isnum(int);

int main()
{
int n,sum=0;
scanf("%d",&n);
for(int i=1;i<=n;i++)
{
if (isnum(i)==1)
{
	sum+=i*i;
}
}
printf("%d",sum);
return 0;
}

int isnum(int i)
{
if (i%10 == 7)
{
return 0;
}
if ((i/10)*10==70)
{
return 0;
}
if (i%7==0)
{
return 0;
}
return 1;
}


void main()
{
int num,i,j,sum=0,mark;
scanf("%d",&num);
for(i=1;i<=num;i++)
{
mark=1;j=i;
if(!(j%7)) mark=0;
while(j)
{
if(j%10==7){mark=0;break;}
else j/=10;
}
if(mark) sum+=i*i;
}
printf("%d",sum);
}


int yu7wuguan(int n)
{
	if(n%7==0)
	{
		return 0;
	}
	for(int i=n;i>0;i/=10)
	{
		if(i%10==7)
		{
			return 0;
		}
	}
	return 1;
}

int main()
{
	int n,sum=0,y=0,i=1;
	scanf("%d",&n);
	for(i=1;i<=n;i++)
	{
		y=0;
		if(yu7wuguan(i))
		{
			y=i*i;
			sum+=y;
		}
		else
		{
			continue;
		}
	}
	printf("%d",sum);
	return 0;
}


int main()
{
	int j,n,s=0;
	scanf("%d",&n);
	for(int i=1;i<=n;i++){
		if(i%7==0){
			continue;
		}
		if(i%10==7){
			continue;
		}
		j=i;
		j=j/10;
		if(j%10==7){
			continue;
		}
		s+=i*i;

	}
	printf("%d",s);
	return 0;
}


int main(){
	int n,sum,a,b;
	scanf("%d",&n);
	int i=1;
	sum=0;
		while(i<=n){
		a=i/10;
		b=i%10;
			if(i%7==0||a==7||b==7){
				sum=sum;
			}else{
				sum+=i*i;
                           }

			i++;
		}
		printf("%d\n",sum);

	return 0;
}


int main()
{
	int n,i,a,sum;
	sum=0;
	a=0;
	scanf("%d",&n);
	for(i=0;i<=n;i++)
	{
		a=i%10;
		if(i%7==0)
		{
			continue;
		}
		else if(a==7)
		{
			continue;
		}
		else if(i==70+a)
		{
			continue;
		}
		sum=sum+i*i;
	}
	printf("%d",sum);
	return 0;
}


int main()
{
	int i,  n, sum = 0;
	scanf("%d", &n);
    for (i = 1; i <= n;i++){
			if (i % 7 == 0) continue;
			else if (i > 69&&i < 80) continue;
			else if ((i - 7) % 10 == 0) continue;
			else
		sum += i*i;
	}
	printf("%d",sum);
	return 0;
}


int judge(int x)
{
    if(x%7==0) return 1;
    int temp=10;
    while(x>0)
    {
     if(x%temp==7) return 1;
      x=x/temp;
     }
     return 0;
     }

int main()
{
    int n;
    cin>>n;
    int a[100];
    int len;len=0;
    for(int i=0;i<=n;i++)
    {
     if(judge(i)==0)
      a[len++]=i;}
    int sum=0;
    for(int j=0;j<len;j++)
    {
     sum=sum+a[j]*a[j];}
    cout<<sum;
    return 0;
    }


int main()
{
	int n,sum=0,i=1;
	scanf("%d",&n);
	while(i<=n)
	{
		if(i%7==0)
		{
			i++;
			continue;
		}
		if(i/10==7)
		{
			i++;
			continue;
		}
		if(i%10==7)
		{
			i++;
			continue;
		}
	    sum+=i*i;
		i++;
	}
	printf("%d",sum);
}


int main(){
	int n;
	int i,sum=0;
	cin>>n;
	for(i=1;i<=n;i++){
		if(i%7==0||i%10==7||(i-i%10)/10==7)
			continue;
		else
			sum=sum+pow((double)i,2.0);
	}
	cout<<sum<<endl;
	return 0;
}


int main()
{
	int n, sum = 0, i = 1;
	cin >> n;
	while (i <= n)
	{
		int a = i%10, b = i - a;
		if (i%7 == 0) i++;
		else
		{
			if (a == 7) i++;
		         else
			{
				if (b == 70) i++;
		                  else sum = sum + i * i;
				         i++;
			}
		}
	}
	cout << sum << endl;
	return 0;
}


int res[102];
int n;
int main()
{
	cin >> n;
	memset(res, 0, sizeof(n));
	for(int i = 1; i <= 100; i++)
	{
		if(i % 10 == 7 || i % 7 == 0 || i / 10 == 7)
			res[i] = res[i - 1];
		else
			res[i] = res[i-1] + i * i;
	}
	cout << res[n] <<endl;
	return 0;
}


int yu7wuguan(int number)
{
	if(number%7==0)
		return 0;
	for(int num=number;num>0;num/=10)
	{
		if(num%10==7)
			return 0;
	}
	return 1;
}
int yu7wuguan(int);
int main()
{
	int num,result=0;
	scanf("%d",&num);
	for(int i=1;i<=num;i++)
	{
		if(yu7wuguan(i))
			result += i*i;
	}
	printf("%d",result);
	return 0;
}


int main()
{
	int n,i,s=0;
	scanf("%d",&n);
	for(i=1;i<=n;i++)
	{	switch(i){
	    case 17:
		case 27:
		case 37:
		case 47:
		case 57:
		case 67:
		case 87:
		case 97:
		case 71:
		case 72:
		case 73:
		case 74:
		case 75:
		case 76:
		case 78:
		case 79:
			continue;
		default:
			if(i%7!=0)
				s=s+i*i;}
	}
	printf("%d",s);
	return 0;
}


int main()
{
	int n,i,temp=0,sum=0,ans=0;
	scanf("%d",&n);
	for(i=1;i<=n;i++)
	{
		temp=i*i;
		sum+=temp;
	}
	for(i=1;i<=n;i++)
		if(i%7==0||i/10==7||i%10==7)
			ans+=i*i;
	sum=sum-ans;
	printf("%d",sum);
	return 0;
}


int main(){
	int n;
	scanf("%d",&n);
	int sum=0,j=1;
	for(j=1;j<=n;j++){
		if(j%7==0){
			continue;
		}
		if(j%10==7 || (int)j/10==7){
			continue;
		}
		sum+=j*j;
	}
	printf("%d",sum);
	return 0;
}


int main()
{
    int ans[100], total, answer;
    int n, i, j;
    total = 0;
    for (i=1;i<100;i++)
    {
        total ++;
        ans[total] = i * i;
        j = i;
        if (j % 7 == 0) {total--;continue;}
        while (j)
        {
            if (j % 10 == 7)
            {
                total --;
                break;
            }
            j /= 10;
        }
    }
    scanf("%d", &n);
    answer = 0;
    for (i=1; i<=total; i++)
    {
        if (n * n < ans[i]) break;
        answer += ans[i];
    }
    printf("%d", answer);
    return 0;
}


int main()
{
int n,i;
unsigned long sum=0;
int judge(int i);
scanf("%d",&n);
for(i=1;i<=n;i++)
{
if(i%7!=0&&judge(i)==0)
sum+=i*i;
}
printf("%ld\n",sum);
return 0;
}
int judge(int i)
{
int k;

if(i>=10)
do
{
k=i%10;
if(k==7)return 1;
i=i/10;
}
while(i>=10);
if(i==7)return 1;
else return 0;

}


int main()
{
  int n,i,s;
  s=0;
  i=0;
  scanf("%d",&n);
  for(i=1;i<=n;i++)
  {
	 if(i%7==0)
	     continue;
	 else if(i%10==7)
		 continue;
         else if(i/10==7)
		 continue;
	 else
		 s=s+i*i;
}
  printf("%d\n",s);
  return 0;
}


int yu7wuguan(int n)
{
	if(n%7==0)
	{
		return 0;
	}
	for(int i=n;i>0;i/=10)
	{
		if(i%10==7)
		{
			return 0;
		}
	}
	return 1;
}

int main()
{
	int n,sum=0,y=0,i=1;
	scanf("%d",&n);
	for(i=1;i<=n;i++)
	{
		y=0;
		if(yu7wuguan(i))
		{

			sum+=i*i;
		}

	}
	printf("%d",sum);
	return 0;
}


int main()
{
	int n,sum=0;
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		if(!(i%7))continue;
		if((i%10)==7)continue;
		if((i/10)==7)continue;
		sum+=i*i;
	}
	cout<<sum;
	return 0;
}


int main()
{
	int n,s;
	scanf("%d",&n);
	for(;n>=0;n--){
		switch(n){
		case 7:
		case 17:
		case 27:
		case 37:
		case 47:
		case 57:
		case 67:
		case 77:
		case 87:
		case 97: s=s;continue;}
		if(n%7==0||n>=70&&n<=79)
			continue;
		else
			s=s+n*n;}

	printf("%d\n",s);
	return 0;
}


int main(){
	int n;
	int result=0;
	scanf("%d",&n);
    int i=1;
	for(i=1;i<=n;i++){
		if((int)i%7==0||(int)i/10==7||(int)i%10==7){
			continue;}

		result+=i*i;}
	    printf("%d",result);
		return 0;
}


int main()
{
	int i, j, n, sum=0;
	scanf("%d", &n);
	for(i=1;i<=n;i++)
	{
		if(i % SHENMI == 0) {continue;}
		if((SHENMI*10 < i) && ((SHENMI+1)*10 > i)) {continue;}
		j = i/10;
		if(((i-j*10) % SHENMI ==0) && ((i-j*10) != 0)) continue;
		sum += i*i;
	}
	printf("%d\n",sum);
	return 0;
}


int main ()
{
	int n, i, x, sum = 0;
	cin >> n;
	for ( i = 1; i <= n; i += 1)
	{ x = i / 10;
	  if ( i % 7 == 0 || i % 10 == 7 )
	     sum = sum;
	    else if ( x == 7 )
		   sum = sum;
		else sum += i * i ;
	}
	cout << sum << endl;
	return 0;
}


int yu7wuguan (int n);
int main(){
	int result=0,n;
	scanf("%d",&n);
	for(int i=1;i<=n;i++){
		if(yu7wuguan(i)){
			result+=i*i;
		}
	}
	printf("%d",result);
	return 0;
}
int yu7wuguan(int n){
	if (n%7==0){
		return 0;
	}
	if(n==71||n==72||n==73||n==74||n==75||n==76||n==78||n==79){
		return 0;
	}
		if(n%10==7){
			return 0;
	}
	return 1;
}


int main()
{
	int i,n;
	int sum=0;
	scanf("%d",&n);
	for(i=1;i<=n;)
	{
		if(i%7==0||(i-7)%10==0)
		{
			i++;
			continue;
		}
		else if(i>70&&i<80)
		{
			i++;
			continue;
		}
		else
		{
		sum+=pow(i,2);
		i++;
		}
	}
	printf("%d\n",sum);
	return 0;
}


int is_relativeto_7(int n);

int main()
{
    int n, i, sum = 0;
    scanf("%d", &n);

    for (i=1; i<=n; i++)
        if (!is_relativeto_7(i))
            sum += i*i;

    printf("%d", sum);
    return 0;
}

int is_relativeto_7(int n)
{
    int sh = n;
    if ((n % 7) == 0) return 1;
    do {
        if ((sh % 10) == 7) return 1;
        sh = sh / 10;
    } while (sh > 0);

    return 0;
}


int main(){
	int n,a,i;
	scanf("%d",&n);
    int tag,sum=0;
	for(i=1;i<=n;i++){
		tag=0;
		if(i%7==0){
			tag=1;
			continue;
		}
		if(tag==0){
			a=i;
            while(a>0){
				if(a%10==7){
					tag=1;
					break;
				}
			    else{
				    a=a/10;
				}
			}
		}
		if(tag==0){
			sum+=i*i;
		}
	}
	printf("%d",sum);
	return 0;
}


int main()
{
int n;
cin>>n;
switch (n)
{

case 1: cout<<"1"; break;
case 2: cout<<"5"; break;
case 3: cout<<"14"; break;
case 4: cout<<"30"; break;
case 5: cout<<"55"; break;
case 6: cout<<"91"; break;
case 7: cout<<"91"; break;
case 8: cout<<"155"; break;
case 9: cout<<"236"; break;
case 10: cout<<"336"; break;
case 11: cout<<"457"; break;
case 12: cout<<"601"; break;
case 13: cout<<"770"; break;
case 14: cout<<"770"; break;
case 15: cout<<"995"; break;
case 16: cout<<"1251"; break;
case 17: cout<<"1251"; break;
case 18: cout<<"1575"; break;
case 19: cout<<"1936"; break;
case 20: cout<<"2336"; break;
case 21: cout<<"2336"; break;
case 22: cout<<"2820"; break;
case 23: cout<<"3349"; break;
case 24: cout<<"3925"; break;
case 25: cout<<"4550"; break;
case 26: cout<<"5226"; break;
case 27: cout<<"5226"; break;
case 28: cout<<"5226"; break;
case 29: cout<<"6067"; break;
case 30: cout<<"6967"; break;
case 31: cout<<"7928"; break;
case 32: cout<<"8952"; break;
case 33: cout<<"10041"; break;
case 34: cout<<"11197"; break;
case 35: cout<<"11197"; break;
case 36: cout<<"12493"; break;
case 37: cout<<"12493"; break;
case 38: cout<<"13937"; break;
case 39: cout<<"15458"; break;
case 40: cout<<"17058"; break;
case 41: cout<<"18739"; break;
case 42: cout<<"18739"; break;
case 43: cout<<"20588"; break;
case 44: cout<<"22524"; break;
case 45: cout<<"24549"; break;
case 46: cout<<"26665"; break;
case 47: cout<<"26665"; break;
case 48: cout<<"28969"; break;
case 49: cout<<"28969"; break;
case 50: cout<<"31469"; break;
case 51: cout<<"34070"; break;
case 52: cout<<"36774"; break;
case 53: cout<<"39583"; break;
case 54: cout<<"42499"; break;
case 55: cout<<"45524"; break;
case 56: cout<<"45524"; break;
case 57: cout<<"45524"; break;
case 58: cout<<"48888"; break;
case 59: cout<<"52369"; break;
case 60: cout<<"55969"; break;
case 61: cout<<"59690"; break;
case 62: cout<<"63534"; break;
case 63: cout<<"63534"; break;
case 64: cout<<"67630"; break;
case 65: cout<<"71855"; break;
case 66: cout<<"76211"; break;
case 67: cout<<"76211"; break;
case 68: cout<<"80835"; break;
case 69: cout<<"85596"; break;
case 70: cout<<"85596"; break;
case 71: cout<<"85596"; break;
case 72: cout<<"85596"; break;
case 73: cout<<"85596"; break;
case 74: cout<<"85596"; break;
case 75: cout<<"85596"; break;
case 76: cout<<"85596"; break;
case 77: cout<<"85596"; break;
case 78: cout<<"85596"; break;
case 79: cout<<"85596"; break;
case 80: cout<<"91996"; break;
case 81: cout<<"98557"; break;
case 82: cout<<"105281"; break;
case 83: cout<<"112170"; break;
case 84: cout<<"112170"; break;
case 85: cout<<"119395"; break;
case 86: cout<<"126791"; break;
case 87: cout<<"126791"; break;
case 88: cout<<"134535"; break;
case 89: cout<<"142456"; break;
case 90: cout<<"150556"; break;
case 91: cout<<"150556"; break;
case 92: cout<<"159020"; break;
case 93: cout<<"167669"; break;
case 94: cout<<"176505"; break;
case 95: cout<<"185530"; break;
case 96: cout<<"194746"; break;
case 97: cout<<"194746"; break;
case 98: cout<<"194746"; break;
case 99: cout<<"204547"; break;

default : break;
}
return 0;
}


int main()
{
	int n,x,y,z;
	int sum = 0;

	scanf("%d",&n);
	int i = n;
	while(i>0)
	{
		x = i%7;
	        y = i/10;
		z = i%10;

		if (x==0||y==7||z==7){
                            i--;
			continue;
}
		sum = sum + i*i;
		i--;
	}
	printf("%d",sum);
    return 0;
}


int main()
{
    int sum=0;
    int s=0;
    int n;
	scanf("%d",&n);
    for(int i=1;i<=n;i++){
		s=s+i*i;
        if(i%7==0){
		   sum=sum+i*i;
		}
		else if(i%10==7){
			    sum=sum+i*i;
		}
        else if(i>70&&i<80){
                sum=sum+i*i;
        }
    }
	s=s-sum;
    printf("%d\n",s);
	return 0;
}


int yuqiwuguan(int number){
	if(number%7==0){
		return 0;}
	for(int num=number;num>0;num=num/10){
		if(num%10==7){
			return 0;
		}

	}
	return 1;
}

int main(){
	int i,sum,n;
	sum=0;
	scanf ("%d",&n);
	for(i=1;i<=n;i++){
		if (yuqiwuguan(i)){
			sum=sum+i*i;
		}
	}
	printf("%d",sum);
	return 0;
}


/*
 * ?The number has no relative to seven?.cpp
 *
 *  Created on: 2010-11-4
 *      Author: acer
 */

int main()
{
	int Num,i,Sum=0;
	cin>>Num;
	int exam(int Num);					//??????

	for(i=0;i<=Num;i++)					//????
		if(exam(i))
			Sum+=i*i;					//????
	cout<<Sum;
	return 0;
}

int exam(int Num)						//????
{
	if(((Num%10)==7)||(((Num-Num%10)/10)==7)||(Num%7==0))
		return 0;						//??7???7?????0  ????1
	else return 1;
}


int main()
{
    int n,i=1,j,sum=0,t=10;
    cin>>n;
    for(i=1;i<=n;i++)
    {if(i%7==0)
         ;
     else
	     {if(i%10==7)
             ;
          else
             {j=i/t;
	         if(j%10==7)
                 ;
             else
                 sum=sum+i*i;
              }
	      }
    }
    cout<<sum<<endl;
    return 0;
}


int seven(int n)
{
	int i, s= 0;
	for (i = 1; i <= n; i++)
	{
		if (i % 10 != 7 && i / 10 != 7 && i % 7 != 0)
		{
			s += i * i;
		}
	}
	return s;
}

int main()
{
	int n;
	cin >> n;
	cout << seven(n) << endl;
	return 0;
}