semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
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(){
double sum[100];
int a=1,b=2,c,d;
int n,i,j[100],k;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&j[i]);
}
for(i=0;i<n;i++){
	sum[i]=0;
	a=1;
	b=2;
	for(k=0;k<j[i];k++){
	sum[i]+=100000*b/a;
	c=b;
	d=a+b;
	a=c;
	b=d;
	}   
	printf("%.3lf\n",sum[i]/100000);
}



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;
}
int main()
{
    int m,n;
    float sum;
    int a[1000]={0};
    scanf("%d",&m);
    int r=0;
    while(r<m){
    scanf("%d",&n);
    int i=0;
    while(i<=n){
    if(i==0){
    a[i]=1;
    }else if(i==1){
    a[i]=2;
    sum=1.0*a[1]/a[0];
    }else{
    a[i]=a[i-1]+a[i-2];
    sum+=1.0*a[i]/a[i-1];
    }
    i++;
    }
    printf("%.3f\n",sum);
    r++;
    }
    return 0;
}
int main()
{
	int m,n,i,j;
	double a[100],b[100],c[100],sum;
	a[0]=1;
	a[1]=2;
	b[1]=1;
	scanf("%d",&m);
	for(i=0;i<m;i++)
	{
		scanf("%d",&n);
		sum=0;
		for(j=0;j<n;j++)
		{
			a[j+2]=a[j]+a[j+1];
			b[j+2]=a[j+1];
			sum+=a[j+1]/b[j+1];
		}
		printf("%.3lf\n",sum);
	}
	return 0;
}
int main(){
	int t,i,r,sz[10000];
	double cz[10000],jz[10000];
	scanf("%d",&t);
	for(i=0;i<t;i++){
		scanf("%d",&sz[i]);
	}
	for(i=0;i<t;i++){
		double sum=0;
		cz[1]=2.0;
		jz[1]=1.0;
		if(sz[i]==1){
			sum+=2.0/1.0;
		}else{
			sum=2.0/1;
			for(r=2;r<=sz[i];r++){
				cz[r]=cz[r-1]+jz[r-1];
				jz[r]=cz[r-1];
				sum=sum+cz[r]/jz[r];
			}
		}
		printf("%.3lf\n",sum);
	}
		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];
}
int main(){
	int m,i,a[100],p,q,k;
	double z[100]={0},b[100];
	scanf("%d",&m);
	for(i=0;i<m;i++){
		scanf("%d",&a[i]);
                       q=2;
                       k=1;
			for(p=0;p<a[i];p++){
				b[p]=1.00000*q/k;
				q+=k;
				k=q-k;
				z[i]+=b[p];
			}
	}
	for(i=0;i<m;i++){
		printf("%.3lf\n",z[i]);
	}
	return 0;
}
int main(){
 int m,sz[1000];
 double sum,e,f,d,jieguo[1000];
 int a,b,c,g; 
 scanf("%d",&m);
 for(a=0;a<m;a++){
  scanf("%d",&sz[a]);                 
 }
 for(b=0;b<m;b++){
  sum=0.0;
  d=2.0;
  e=1.0;
  f=0.0;
  for(c=0;c<sz[b];c++){
    d+=f;
    sum+=(d/e);
    f=e;
    e=d;                   
  }
  jieguo[b]=sum;                 
 }
 for(g=0;g<m-1;g++){
  printf("%.3lf\n",jieguo[g]);                   
 } 
 printf("%.3lf",jieguo[m-1]);
 return 0;  
}
int main(){
int n;
scanf("%d",&n);int m;float a[100];int b[100][100];int c[100][100];


for(int d=0;d<n;d++)
{a[d]=3.5000000;}

for(int i=0;i<n;i++){
scanf("%d",&m);
  for(int j=0;j<m;j++)
  {
	  if(j==0){b[i][j]=2;}
	  if(j==1){b[i][j]=3;}
	  if(j>=2){b[i][j]=b[i][j-1]+b[i][j-2];}
      if(m!=1&&j>1){a[i]+=1.0000*b[i][j]/b[i][j-1];}
	  if(m==1){a[i]=2.0000000;}

  }

}

for(int o=0;o<n;o++)
{
printf("%.3f\n",a[o]);

}


return 0;
}
int main()
{
	int m,n,i,j,a[100],b[100];
	double sum;
	a[0]=2;
	a[1]=3; 
	for(j=2;j<100;j++)
	a[j]=a[j-1]+a[j-2];
	b[0]=1;
	b[1]=2;
	for(j=2;j<100;j++)
	b[j]=b[j-1]+b[j-2];
	scanf("%d",&m);
	for(i=0;i<m;i++)
	{
		sum=0;
		scanf("%d",&n);
	    for(j=0;j<n;j++)
	    sum+=(double)a[j]/b[j];
		printf("%.3lf\n",sum);
	
	}
	return 0;
}
int main()
{
	int m, n;
	cin >> m;
	int i;
	for ( i = 1; i <= m; i++ )
	{
		cin >> n;
		double a[1000][2];
		int j;
		a[0][1] = 1;
		a[1][1] = 2;
		for ( j = 2; j < n; j++ )
			a[j][1] = a[j-1][1] + a[j-2][1];
		a[0][0] = 2;
	    for ( j = 1; j < n; j++ )
			a[j][0] = a[j-1][0] + a[j-1][1];
		double sum = 0, mul = 1;
		for ( j = 0; j < n; j++ )
			mul = mul * a[j][1];
		for ( j = 0; j < n; j++ )
			{
				a[j][0] = a[j][0] * ( mul / a[j][1] );
				sum = sum + a[j][0];
		}
		cout << fixed << setprecision(3) << sum / mul << endl;
	}
	return 0;
}
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 main()
{
	double fz[10000],fm[10000],s;
	fz[0]=2;
	fm[0]=1;
	s=fz[0]/fm[0];
	int n,gs,j,i=0;
	scanf("%d",&n);
	while(i<n)
	{
		scanf("%d",&gs);
		for(j=1;j<gs;j++)
		{
			fz[j]=fz[j-1]+fm[j-1];
			fm[j]=fz[j-1];
			s+=(fz[j]/fm[j]);
		}
		printf("%.3lf\n",s);
		i++;
		s=fz[0]/fm[0];
	}
	return 0;
}
int main()
{
    int m,n,i,j;
    int a[100],b[100];
    double sum=0.00;
    b[1]=1;b[2]=2;
    scanf("%d",&m);
    for(i=1;i<=m;i++)
    {
        scanf("%d",&n);
        a[i]=n;
     }
     for(i=2;i<=99;i++)
     {
        b[i+1]=b[i]+b[i-1];
      }
    for(i=1;i<=m;i++)
    {
        for(j=1;j<=a[i];j++)
        {
           sum=sum+1.0*b[j+1]/b[j];
    
         }
        printf("%.3lf\n",sum);
        sum=0.00;
     }
     return 0;
}
int main(){
	int m,n,i,u;
	double add,each1[100],each2[100];
	scanf("%d",&m);
	for(i=0;i<m;i++){
		scanf("%d",&n);
		each1[0]=2;
		each1[1]=3;
		each2[0]=1;
		each2[1]=2;
		add=3.5;
		for(u=2;u<n;u++){
			each1[u]=each1[u-1]+each1[u-2];
			each2[u]=each2[u-1]+each2[u-2];
			add+=1.0*each1[u]/each2[u];
		}
		if(n==1){
			printf("2.000\n");
		}else{
			printf("%.3lf\n",add);
		}
	}
	return 0;
}
int main()
{
  int m,n;
  double x;
 
  scanf("%d",&m);

  for(int i=1;i<=m;i++){
    scanf("%d",&n);  
    int sz[n+1];
    for(int j=0;j<n+1;j++){
      sz[j]=sz[j-1]+sz[j-2];
      sz[0]=1;
      sz[1]=2;
    }
    x=0;
    for(int j=1;j<n+1;j++){
      x+=1.0*sz[j]/sz[j-1];
    }
    printf("%.3lf\n",x);
  }
  return 0;
}
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()
{
	int i, j, m, n  ;
	double a=1, b=1, s=0,t;
	double d,sum[MAX];
    scanf("%d",&m);
   
	for(i=0;i<m;i++){
		s=0;
		a=1;b=1;
		scanf("%d",&n);
		for(j=1;j<=n;j++){
			d=(a+b)/b;
			s=s+d;
			t=b;
			b=a+b;
			a=t;
		}
		sum[i]=s;
	}
	for(i=0;i<m;i++){
		printf("%.3lf\n",sum[i]);
	}

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

	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 main()
{
	int n,i,k,a[1000],b[1000],c[1000];
	double d[1000],sum[1000];
	b[0]=2;
	c[0]=1;
	b[1]=3;
	c[1]=2;
	scanf("%d",&n);
	for(i=0;i<n;i++)
		scanf("%d",&a[i]);
	for(i=0;i<n;i++)
	{
		sum[i]=0;
		for(k=0;k<a[i];k++)
		{
			if(k>=2)
			{
				b[k]=b[k-1]+b[k-2];
				c[k]=c[k-1]+c[k-2];
			}
			d[k]=b[k]/(double)(c[k]);
			sum[i]+=d[k];
		}
		printf("%.3f\n",sum[i]);
	}
	return 0;
}
int main()
{
	int n,i,j,t;
	double a[100]={1,2};
	double b[100];
	double sum=0;
	scanf("%d",&n);
	for(i=2;i<100;i++){
		a[i]=a[i-1]+a[i-2];
	}
	for(i=0;i<99;i++){
		b[i]=a[i+1]/a[i];
	}
	for(i=0;i<n;i++){
		scanf("%d",&t);
	for(j=0;j<t;j++){
		sum=sum+b[j];
	}
	printf("%.3lf\n",sum);
        sum=0;
	}
	return 0;
}
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,i,j;
	int n[100]={0};
	scanf("%d",&m);

	double a1=2;
	double a2=3;
	double b1=1;
	double b2=2;
	double a3,b3;
	double slot;
	double sum;
	for(i=0;i<m;i++)
	{
		scanf("%d",&n[i]);
		if(n[i]==1) printf("%.3lf\n",(a1/b1));
		if(n[i]==2) printf("%.3lf\n",(a1/b1)+(a2/b2));
		if(n[i]>2)
		{
			sum=(a1/b1)+(a2/b2);
			for(j=0;j<n[i]-2;j++)
			{
				a3=a1+a2;
				b3=b1+b2;
				sum+=(a3/b3);
				slot=a2;
				a2=a1;
				a1=slot;
				slot=b2;
				b2=b1;
				b1=slot;
				slot=a3;
				a3=a2;
				a2=slot;
				slot=b3;
				b3=b2;
				b2=slot;
			}
			printf("%.3lf\n",sum);
			a1=2;
			a2=3;
			b1=1;
			b2=2;
			sum=(a1/b1)+(a2/b2);
		}
	}

	return 0;
}
int main()
{
	int m;
	scanf("%d",&m);
	int i,j;
	double sz[999],r[999]={0};
	for(i=1;i<=m;i++)
	{
		scanf("%lf",&sz[i]);
	}
	int a1,a2,b1,b2,e1,e2;
	for(i=1;i<=m;i++)
	{
		a1=1;
		a2=2;
		b1=1;
		b2=1;
		for(j=1;j<=sz[i];j++)
		{
			r[i]=r[i]+1.0*a2/b2;
			e1=a2;
			e2=a1+a2;
			a1=e1;
			a2=e2;
			e1=b2;
			e2=b1+b2;
			b1=e1;
			b2=e2;
		}
		printf("%.3lf\n",r[i]);
	}
	return 0;
}
int main(){
	int m,i,j,k,h,n;
    double sum[1000];
	int a[1000],c[1000];
	double b[1000];

    c[0]=1;
	c[1]=2;
    for(n=2;n<1000;n++){
		c[n]=c[n-1]+c[n-2];
	}
	scanf("%d",&m);
	for(j=0;j<m;j++){
		sum[j]=0;
	}

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

       for(k=0;k<a[i];k++){
	     b[k]=1.0*c[k+1]/c[k];
	     sum[i]=sum[i]+b[k];
	   }
	}
    
    for(h=0;h<m;h++){
	printf("%.3lf\n",sum[h]);
	}

    
	return 0;

}
int main()
{
	int n,i,j,k,p;
	double a[100],fenzi[100],fenmu[100],sum[100]={0.0};
	fenzi[0]=2.0;
	fenzi[1]=3.0;
	fenmu[0]=1.0;
	fenmu[1]=2.0;
	a[0]=2.0;
	a[1]=1.5;
	for(i=2;i<100;i++)
	{
		fenzi[i]=fenzi[i-1]+fenzi[i-2];
		fenmu[i]=fenmu[i-1]+fenmu[i-2];
		a[i]=fenzi[i]/fenmu[i];
	}
	scanf("%d", &n);
	for(p=0;p<n;p++)
	{
		scanf("%d",&j);
		for(k=0;k<j;k++)
		{
			sum[p]+=a[k];
		}
		printf("%.3lf\n", sum[p]);
	}
	return 0;
}
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 = 0, n = 0;					//m?????????n
	cin >> m;
	for ( int i = 0; i < m; i ++ )
	{
		cin >> n;
		double add = 2, x = 2, y = 1;	//??????????
		for ( int j = 1; j < n; j ++ )
		{
			x = x + y;
			y = x - y;
			add = add + x / y;
		}
		printf ("%.3f", add );
		cout << endl;
	}
	return 0;
}
int main()
{
	int m,i,n,j,a,b,t;
	scanf("%d",&m);
    for(i=0;i<m;i++){
		float sum=0;
	    scanf("%d",&n);
		int a1=1,a2=1,b1=0,	b2=1;
		for(j=0;j<n;j++){
			a=a1+a2;
			b=b1+b2;
			sum=sum+1.0*a/b;
			t=a;
			a1=a2;
            a2=t;
            t=b;
			b1=b2;
            b2=t;
		}
		printf("%.3f\n",sum);
	}
    return 0;
}
int main(){
	int i,j,n;
	scanf("%d",&n);

	int sz[10000];
	for(i=0;i<n;i++){
		scanf("%d",&sz[i]);
	}
	int zr[10000][2];
	zr[0][0]=2;
	zr[0][1]=1;
	zr[1][0]=3;
	zr[1][1]=2;
	for(i=2;i<10000;i++){
		zr[i][0]=zr[i-1][0]+zr[i-2][0];
		zr[i][1]=zr[i-1][1]+zr[i-2][1];
	}

	double fs[10000]={0};
	for(i=0;i<10000;i++){
		fs[i]=(double)zr[i][0]/zr[i][1];
	}
	double jg[10000]={0};
	for(i=0;i<n;i++){
		for(j=0;j<sz[i];j++){
			jg[i]+=fs[j];
		}
	}
	for(i=0;i<n;i++){
		printf("%.3lf\n",jg[i]);
	}
	return 0;
}
int main()
{
	int n,m,i,j,a[100];
	double c;
	c=0;
	scanf("%d",&m);
	a[1]=1;
	a[2]=2;
	for(i=3;i<100;i++)
	{
		a[i]=a[i-1]+a[i-2];
}
	for(i=0;i<m;i++)
	{
		scanf("%d",&n);
		for(j=1;j<=n;j++)
		{
			c=c+(double)a[j+1]/a[j];
		}
		printf("%.3lf\n",c);
c=0;
	}
	return 0;
}
int main(){
	int m,n,i,j,r1,e,r2,p1,f,p2;
	double s=0;
	scanf("%d",&m);
	for(i=0;i<m;i++){
		scanf("%d",&n);
		r1=2;
		r2=3;
		p1=1;
		p2=2;
if(n==1){
s=2.000;
}else if(n==2){
s=2.000+1.500;
}else{
		s=(double)r1/p1+(double)r2/p2;
		for(j=2;j<n;j++){
			e=r2;
			r2=r1+r2;
			r1=e;
			f=p2;
			p2=p1+p2;
			p1=f;
			s=s+(double)(r2)/(p2);
}
			

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


	return 0;
}
int main()
{
    int n,i,a,p;
    int sz[100];
    int sz1[100];
    sz[0]=1;
    sz[1]=2;
    float sum;
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
        scanf("%d",&sz1[i]);
    }
    for(p=0;p<n;p++)
    {   sum=2;
        for(i=2;i<=sz1[p];i++)
        {
             sz[i]=sz[i-1]+sz[i-2];
             sum=(float)sum+(float)sz[i]/sz[i-1];
        }
        printf("%.3f\n",sum);
    }
    scanf("%d",&n);
    return 0;
}
int main(){
    int i,m,n,k,j,g[100];
	double z[100],sum,s[102];
	s[0]=1;
	s[1]=2;
	k=0;
	for(i=0;i<21;i++){
	  s[i+2]=s[i]+s[i+1];
	  z[k]=s[i+1]/s[i];
	  k++;
	  }
	  scanf("%d",&m);
	  for(n=0;n<m;n++){
	  scanf("%d",&g[n]); 
	  }
	  for(n=0;n<m;n++){
		  sum=0;
	     k=0;
		 for(j=0;j<g[n];j++){
	     sum+=z[k];
		 k++;
		 }
      printf("%.3lf\n",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,m[200],i,j;
	double s[200],p[200],q[200];
	scanf("%d",&n);
	p[0]=2;
	q[0]=1;
	s[0]=p[0]/q[0];
	for(i=0;i<n;i++)
	{
		scanf("%d",&m[i]);
		for(j=1;j<m[i];j++)
		{
			p[j]=p[j-1]+q[j-1];
			q[j]=p[j-1];
			s[j]=p[j]/q[j];
			s[j]+=s[j-1];
		}
     	printf("%.3lf\n",s[j-1]);
	}
	return 0;
}
int main()
{
    int m,i=0,a[max],p;
    float fz[max]={2,2},fm[max]={1,1},sum=2;
    scanf("%d",&m);
    for(i=0;i<m;i++){
       scanf("%d",&a[i]);
    }
    for(i=0;i<m;i++){
		for(p=0;p<2;p++){
		   fz[p]=2;
		   fm[p]=1;
		}
		sum=2;
       for(p=2;p<=a[i];p++){
       fz[p]=fz[p-1]+fm[p-1];
       fm[p]=fz[p-1];
       sum+=fz[p]/fm[p];
   } printf("%.3f\n",sum);
} 
   
return 0;
}
int main(){
	int n[100],i,m,j;
	double x[100],y[100];
	double a[100];
	scanf("%d",&m);
	for(i=0;i<m;i++){
		scanf("%d",&n[i]);
	}
	for(i=0;i<m;i++){
		x[0]=2;y[0]=1;
		x[1]=3;y[1]=2;
		a[i]=x[0]/y[0];
		for(j=1;j<n[i];j++){
			if(j>1){
				x[j]=x[j-1]+x[j-2];
				y[j]=y[j-1]+y[j-2];
			}
			a[i]=a[i]+x[j]/y[j];
		}
	}
	for(i=0;i<m;i++){
		printf("%.3lf\n",a[i]);
	}
	return 0;
}
main()
{
    int a[10000],b[10000];
    int n,m,i,j;
    double sum=0;
    a[0]=1;a[1]=2;b[0]=2;b[1]=3;
    for (i=2;i<10000;i++)
    {
        b[i]=b[i-1]+b[i-2];
        a[i]=b[i-1];
    }
    scanf("%d",&n);
    for (i=0;i<n;i++)
    {
        sum=0;
        scanf("%d",&m);
        for (j=0;j<m;j++)
        sum+=(double)b[j]/(double)a[j];
        printf("%.3lf\n",sum);
    }
}
int main(int argc, char* argv[])
{
	int m,sz[100],i,sl[500],j;
	scanf("%d",&m);
	for(i=0;i<m;i++){
		scanf("%d",&sz[i]);
	}
	sl[0]=1;
	sl[1]=2;
	for(i=2;i<500;i++){
		sl[i]=sl[i-1]+sl[i-2];
	}
	double fs[500],sum[500]={0};
	for(i=0;i<500;i++){
		fs[i]=(double)sl[i+1]/sl[i];
	}
	for(i=0;i<m;i++){
		for(j=0;j<sz[i];j++){
			sum[i]=fs[j]+sum[i];
		}
		printf("%.3lf\n",sum[i]);
	}

	

	return 0;
}
int main()
{
	float a[1000];
	float b[1000];
	int m,i,n,j;
	float s=0;
	a[1]=1;
	a[2]=2;
	for(i=3;i<999;i++)
	{
		a[i]=a[i-1]+a[i-2];
	}
	b[1]=2;
	for(i=2;i<1000;i++)
	{
		b[i]=(a[i-1]/a[i])+1;
	}
	scanf("%d",&m);
	for(i=0;i<m;i++)
	{
		scanf("%d",&n);
		for(j=1;j<=n;j++)
		s=s+b[j];
		printf("%.3f\n",s);
		s=0;
	}
	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 m;
	int n;
	int i,k;
	int a[1000000];
	int b[1000000];
	double x,y;
	scanf("%d",&m);
	for(i=0;i<m;i++)
	{
		a[0]=2;a[1]=3;
		b[0]=1;b[1]=2;
		scanf("%d",&n);
		if(n==1)
		{
			x=a[0]*1.0/b[0];
			printf("%.3lf\n",x);
		}else if(n==2)
		{
			x=a[0]*1.0/b[0]+a[1]*1.0/b[1];
			printf("%.3lf\n",x);
		}else if(n>=3){
			y=a[0]*1.0/b[0]+a[1]*1.0/b[1];
			for(k=2;k<n;k++)
			{
				a[k]=a[k-1]+a[k-2];
				b[k]=b[k-1]+b[k-2];
				y=y+a[k]*1.0/b[k];
			}
			printf("%.3lf\n",y);
		}
	}
	return 0;
}
//**********************************
//****       ??????      *****
//****        1200012718       *****
//**        ???????        **
//**********************************
int main ()
{
	int m;
	cin>>m;                            //????m
	double a=1,b=1,c,n,sum=0;         //abc???????????sum??
	for (int i=1;i<=m;i++)
	{
		cin>>n;                   //??n??
		a=1,b=1,sum=0;            //???????ab?????sum
		for (int j=1;j<=n;j++)
		{
		     c=a+b;               //c=a+b  ??????
		     sum=sum+c/b;
		     a=b;           
		     b=c;                //???c/b???a?b???????
		}
		printf("%.3f\n",sum);   //???????sum
	}

	return 0;
}
int main()
{
	int m,i,n,a[100];
	float N,x[100],y[100];
	scanf("%d",&m);
	x[1]=2; x[2]=3; y[1]=1; y[2]=2;
	for(i=1;i<=m;i++)
	{
		
		scanf("%d",&a[i]);
		if(a[i]==2)
		{
			N=3.5;
		}
		else if(a[i]==1)
		{
			N=2;
		}
		else
		{
			N=x[1]/y[1]+x[2]/y[2];
			for(n=3;n<=a[i];n++)
			{
				x[n]=x[n-1]+x[n-2];
				y[n]=y[n-1]+y[n-2];
				N=N+x[n]/y[n];
			}
		}
		printf("%.3f\n",N);
	}
	return 0;
}
int main(){
    int m,n,i,k,N=100;
    double a[N],b;
    scanf("%d",&m);
    for(i=0;i<m;i++){
        scanf("%d",&n);
        a[0]=1.0;a[1]=2.0;b=0;
        for(k=2;k<=n+1;k++){
            a[k]=a[k-1]+a[k-2];
            b=b+(a[k-1]/a[k-2]);
        }
        printf("%.3lf\n",b);
    }
    return 0;
}
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 main()
{int m,n,i,j;
float s;
cin>>m;
for(i=1;i<=m;i++)
{
s=0;
                 cin>>n;
float a[n];
float b[n];
float c[n];


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

	}
     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 fbnq(int);
int main(){
	int m,i,j;
	int n[100];
	double a[100],sum[100]={0.00};
	scanf("%d",&m);
	for(i=0;i<m;i++){
		scanf("%d",&(n[i]));
	}
	for(j=0;j<m;j++){
    	for(i=1;i<=n[j];i++){
			sum[j]+=(double)fbnq(i+1)/fbnq(i);
		}
	}
	for(i=0;i<m;i++){
		printf("%.3f\n",sum[i]);
	}
    return 0;
}
int fbnq(int b){
	int f0,f1,f2;
	f0=1;
	f1=1;
	if(b==1){
		return f1;
	}
	for(int i=2;i<=b;i++){
		f2=f0+f1;
		f0=f1;
		f1=f2;
	}
	return f2;
}
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;
}
int main()
{
int m,n;
scanf("%d",&m);
for (int i=0;i<m;i++)
{
scanf("%d",&n);
float s=0;
int a[n+2];
a[1]=1;
a[0]=1;
for (int j=2;j<n+2;j++)
a[j]=a[j-1]+a[j-2];
for (int j=1;j<=n;j++)
{
s+=1.0*a[j+1]/a[j];
}
printf("%.3f\n",s);
}
}
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;
}
int f(int a);

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



int main(){
	int m,n[100],i,j;
	double sum[100];

	scanf("%d",&m);

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

	for(i=0;i<m;i++){
		sum[i]=0.000;
		for(j=0;j<n[i];j++){
			sum[i]+=(1.000*f(j+1))/(1.000*f(j));
		}
		printf("%.3lf\n",sum[i]);
	}

	return 0;
}
int main()
{
	int m,i,j,n[1000];
	double t,k,l;
	scanf("%d",&m);
	for(i=0;i<m;i++)scanf("%d",&n[i]);
    for(i=0;i<m;i++)
	{
		t=0;k=2;l=1;
		for(j=0;j<n[i];j++)
		{
			t=t+k/l;
			k=k+l;
			l=k-l;

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