semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
/*??
?????????????: ?????????????1????????????2?????
???????a???????????a??????   */
/*????
?1?????????n?????n???????????1?????????a(1 <= a <= 20)
????
n????????????????????????????????a?????*/
int WWW(int x);
int main()
{
	int n;
	cin>>n;
	int a[n];
	for(int i=0;i<n;i=i+1)
	{	cin>>a[i];}
	for(int i=0;i<n;i=i+1)
		{int b;
		b=WWW(a[i]);
		cout<<b<<endl;}
		return 0;
}
int WWW(int x)
{     int p=1,q;
       for(int y=0,z=1,i=0;i<x-1;i=i+1)
	{
		p=y+z;
		y=z;
		z=p;}
       q=p;
       return q;
}
int main()
{
    int *a;
    int n,i;
    int f(int x);
    scanf("%d",&n);
    a=(int *)malloc(n*sizeof(int));
    for(i=0;i<n;i++)
    scanf("%d",&a[i]);
    for(i=0;i<n;i++)
    {
        printf("%d\n",f(a[i]));
    }

}
 int f(int x)
    {
        if(x==1||x==2)
        return(1);
        else
        return(f(x-1)+f(x-2));
    }
int fei(int n)
{
    if(n==1||n==2)
    return 1;
    else 
    return fei(n-1)+fei(n-2);
}
int main()
{ 
    int n;
    scanf("%d",&n);
    for(int i=0;i<n;i++)
    {
            int p=0;
            scanf("%d",&p);
            int q=fei(p);
            printf("%d\n",q);
    }
}
int main(){
int n,u[1000],i,a1,a2,a,j;
scanf("%d",&n);
for(i=0;i<n;i++){scanf("%d",&u[i]);}
for(i=0;i<n;i++){a1=1;a2=1;
for(j=1;j<=u[i];j++){if(j==1||j==2){a=1;}
else{a=a1+a2;a1=a2;a2=a;}
}printf("%d\n",a);
}
return 0;
}
/*
 * find.cpp
 *
 *  Created on: 2012-10-7
 *      Author: Administrator
 */
int fob(int j){             		//??????j????????
	if (j==1 || j==2) return 1;		//????????
	else {
			int a=1,b=1,c;
			for (int k=3;k<=j;k++){c=a+b;a=b;b=c;}
			return c;
	}

}
int main(){
	int n,i;
	cin>>n;									//?????n,??????????

	int a[n];
	for (i=1;i<=n;i++){cin>>a[i];}			//???a[0]
	for (i=1;i<=n;i++){cout<<fob(a[i])<<endl;}
	return 0;
}
int shulie(int);
int num[100] = {0};

int main()
{
	int a, n, k;
	cin >> n;
	for (k = 0; k < n; k++)
	{
		cin >> a;
		cout << shulie(a) << endl;
	}
	return 0;
}
int shulie(int a)
{
	if (a == 1 || a == 2)
		return 1;
	num[a] = shulie(a -1) + shulie(a - 2);
	return num[a];
}
int pb(int n);
int main(){
int i,a,n,k,s[1000];
scanf("%d",&k);
for(i=0;i<k;i++){

scanf("%d",&n);
s[i]=pb(n);
}


for(i=0;i<k;i++){
printf("%d\n",s[i]);
}
return 0;
}


int pb(int m){
	
	int sz[100000];
	sz[1]=1;sz[2]=1;
	for(int i=3;i<=m;i++){
	sz[i]=sz[i-1]+sz[i-2];
	}
return sz[m];
}
int main(){
    int n;
    scanf("%d",&n);
    int a[30];
    int b[30][100];
    for(int i=0;i<=29;i++){
            b[i][1]=1;
            b[i][2]=1;}
    for(int i=0;i<n;i++){
            scanf("%d",&a[i]);
            if((a[i]==1)||(a[i]==2)){
                                 printf("%d\n",b[i][a[i]]=1);}
            else{
                 for(int j=3;j<=a[i];j++){
                     b[i][j]=b[i][j-1]+b[i][j-2];
                    }
                   printf("%d\n",b[i][a[i]]); }
            }
            scanf("%d",&n);
    return 0;}
int main()
{
    int n,a[10000],b;
    scanf("%d",&n);
    int i;
    for(i=1;i<=n;i++)
    {
        scanf("%d",&b);
        a[1]=1;a[2]=1;
        for(int j=3;j<=b;j++)
        a[j]=a[j-1]+a[j-2];
        printf("%d\n",a[b]);
    }
    getchar();
    getchar();
    getchar();
    getchar();
}
main()
{
   int n,i,a[10000],b[10000];
   int cal(int x);
   scanf("%d",&n);
   for(i=1;i<=n;i++) {scanf("%d",&a[i]);}
   for(i=1;i<=n;i++) {b[i]=cal(a[i]);}
   printf("%d",b[1]);
   for(i=2;i<=n;i++) {printf("\n%d",b[i]);}
}

int cal(int x)
{
   int i,a[30],t;
   a[1]=1;a[2]=1;
   for(i=3;i<=30;i++) {a[i]=a[i-1]+a[i-2];}
   t=a[x];
   return(t);
}
int main()
{
	int *n,x,i,*ans;
	int fibonacci(int);
	scanf("%d",&x);
	n=(int *)calloc(x,sizeof(int));
	ans=(int *)calloc(x,sizeof(int));
	for(i=0;i<x;i++)
	{
		scanf("%d",&n[i]);
	}
	for(i=0;i<x;i++)
	{
		ans[i]=fibonacci(n[i]);
		printf("%d\n",ans[i]);
	}
}
int fibonacci(int n)
{
	if(n==1 || n==2) return 1;
	else return fibonacci(n-2)+fibonacci(n-1);
}
int main()
{
int n,a;
scanf("%d",&n);
for (int i=0;i<n;i++)
   {
   scanf("%d",&a);
   int b[a];
   if (a==1||a==2) printf("1\n");
   else
       {
       b[0]=1;
       b[1]=1;
       for (int j=2;j<a;j++)
          b[j]=b[j-1]+b[j-2];
       printf("%d\n",b[a-1]);
       }
   }
}
int main(){
	int f[20];
	f[1]=1;
	f[0]=1;
	int n;
	int a[20];
	for(int i=2;i<=19;i++)
		f[i]=f[i-1]+f[i-2];
	cin>>n;
	for(int i=0;i<=n-1;i++)
		cin>>a[i];
	for(int i=0;i<=n-1;i++)
		cout<<f[a[i]-1]<<endl;//????1????

}
int he(int x);
int main()
{
int n,a;
scanf("%d",&n);
for(int i=0;i<n;i++)
{
scanf("%d",&a);

printf("%d\n",he(a));
}
return 0;
}
int he(int x)
{
if(x==1){ return 1;}
if(x==2){ return 1;}
int sz[20],e;
sz[0]=1;sz[1]=1;
for(e=3;e<=x;e++)
{
	sz[e-1]=sz[e-2]+sz[e-3];}
return sz[x-1];
}
int main()
{
	int n,j,i,a[10000],b[20];
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d",&a[i]);
	}
	for(j=0;j<n;j++){
	  for(i=0;i<a[j];i++){
		if(i==0||i==1){
			b[i]=1;
		}else{
			b[i]=b[i-2]+b[i-1];
		}
	  }
	  printf("%d\n",b[a[j]-1]);
	}
	return 0;
}
int main(){
	int n,f[21]={1,1};
	cin>>n;
	for (int j=2;j<20;j++)
		f[j]=f[j-1]+f[j-2];
	for(int i = 0;i<n;i++){
		int x;
		cin>>x;
		cout<<f[x-1]<<endl;
	}
	return 0;
}
int s[100];
int sl(int i,int n);
int main()
{
int i;
int n;
int s[100];
int a[100];
int b[100];
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&a[i]);
}

for(i=0;i<n;i++){
  b[i]=sl(i,a[i]);
printf("%d\n",b[i]);
}
return 0;
}
int sl(int i,int n){
	int r;
s[0]=1;
s[1]=1;
for(i=2;i<n;i++){
   s[i]=s[i-1]+s[i-2];
}
r=s[n-1];
return r;
}
int main()
{
	int n, i, j, a[100], b[21] = {0, 1, 1};
	cin>>n;
	for (i = 0; i < n; i++)
	{
		cin>>a[i];
		if (a[i] == 1 || a[i] == 2)
			cout<<1<<endl;
		else
		{
			for (j = 3; j <= a[i]; j++)
			{
				b[j] = b[j - 1] + b[j - 2];
			}
			cout<<b[j - 1]<<endl;
		}
	}
	return 0;
}
int main()
{

	int a,b[30],n,i=0,j=2,sum=2;
     scanf("%d",&n);
	 for(i=0;i<n;i++)
	 {
	 scanf("%d",&a);
     b[0]=1;
	 b[1]=1;
	
    for(j=2;j<a;j++)
	 {
	 b[j]=b[j-1]+b[j-2];
	 
	}
	printf("%d\n",b[j-1]);
	 }
	    
	return 0;
}
main()
{
int a,b,c,i,j;
int d[1000];
int e[1000];
scanf("%d",&a);
for(i=0;i<a;i++)
scanf("%d",&d[i]);
for(i=0;i<a;i++)
{e[0]=1;
e[1]=1;
if(d[i]<=2)
printf("1");
else
{for(j=2;j<d[i];j++)
e[j]=e[j-1]+e[j-2];
printf("%d\n",e[j-1]);
}
}
}
main()
{ int n,i,j,a;
  int b[21];
  b[1]=1; b[2]=1;
  scanf("%d",&n);
 for(j=3;j<=20;j++)
   b[j]=b[j-1]+b[j-2];
 
 for(i=1;i<=n;i++)
{  scanf("%d",&a);
if(i==1)
     printf("%d",b[a]);
   else
printf("\n%d",b[a]);
}
getchar();
getchar();
}
int main()
{
 int i,j,n,a[1000],m;
 a[1]=1;
 a[2]=1;
 for (i=3;i<30;i++)
 a[i]=a[i-1]+a[i-2];
 scanf("%d",&n);
 for (i=0;i<n;i++)
 {
 scanf("%d\n",&m);
 printf("%d\n",a[m]);
 }
}
int main()
{
    int i,n,a[20],m;
    int f[20]={1,1};
    for(i=2;i<20;i++)
    f[i]=f[i-2]+f[i-1];
    scanf("%d",&n);
    for(i=1;i<=n;i++)
    {
    scanf("%d",&m);
    a[i]=f[m-1];
    }   
    for(i=1;i<=n;i++)
    printf("%d\n",a[i]);
    getchar();
    getchar();
    return 0;
}
main()
{
    int t[20],n,i,j,a,b,c;
    i=0;
    scanf("%d",&n);
    while (i<n)
    {
        scanf("%d",&t[i]);
        i=i+1;
    }
    i=0;
    while (i<n)
    {
        a=1;
        b=1;
        j=1;
        while (j<t[i])
        {
            c=b;
            b=a+b;
            a=c;
            j=j+1;
        }
        printf("%d\n",a);
        i=i+1;
    }
}
int main()
{
int a[21],m,p;
a[0]=0;
a[1]=1;
for(int i=2;i<21;i++){
        a[i]=a[i-1]+a[i-2];
        }
int n;
scanf("%d",&n);
for(int j=0;j<n;j++){
    scanf("%d",&p);
    printf("%d\n",a[p]);
}
        int hou;
        scanf("%d",&hou);
return 0;
}
int main()
{
	int a[21],i,n;
	a[0]=1;
	a[1]=1;
	cin>>n;
	for(i=1;i<20;i++)
	{
		a[i+1]=a[i]+a[i-1];
	}
	while(cin>>i)
	{
		cout<<a[i-1]<<endl;
	}
	return 0;
}
int f[100],i ,j ,k;

void cal()
{
	f[0]=1;
	f[1]=1;
	f[2]=1;
	int i;
	for(i=3;i<21;i++)
	{
		f[i] = f[i-1] + f[i-2];
	}
}
int main()
{
	int n;
	cin>>n;
	cal();
	while(n--)
	{
		int m;
		cin>>m;
		cout<<f[m]<<endl;
	}
	return 0;
}
/*
 *100022.cpp
 *????????????a?????
 *Created on: 2012-10-13
 *Author:??
 */
int shuchu[20];//????
int shuru[100];
int n=0,i=0,k=0;
int main(){
	cin>>n;
	for(k=0;k<n;k++){//????
		cin>>shuru[k];
		cout<<endl;
	}
	shuchu[0]=1;
	shuchu[1]=1;
	for(i=2;i<20;i++){//????
		shuchu[i]=shuchu[i-1]+shuchu[i-2];
	}

	for(k=0;k<n;k++){
		cout<<shuchu[shuru[k]-1]<<endl;
	}
return 0;
}
int main()//???
{
	int i,n;
	cin >> n;
	for ( i = 0; i < n ; i++ )
		{
			int a,p = 1,q = 1,o,j;
			cin >> a;
			for ( j = 1; j <= a; j++)//??a?????
			{
				if ( j == 1 || j == 2 )
					p = 1;
				else 
				{
					o = p;
					p = p + q;//?a?????
					q = o;//?a-1?????
				}
			}
			cout << p <<endl;
	}
	return 0;    
}
/*
 * ??????.cpp
 *
 *  Created on: 2012-10-4
 *      Author:LiMingyang
 *      ???????????????
 */
int main(){
	int i,j,k,n,fei[20];//????
	cin>>n;//????????
	const int n1=n;//?????n1??????
	int a[n1],b[n1];//?????????????
	for (i=0;i<n1;i++)
		cin>>a[i];//?????????
	fei[0]=fei[1]=1;//???????1,2????1
	for (j=2;j<=20;j++)
		fei[j]=fei[j-1]+fei[j-2];//?????????
	b[0]=fei[a[0]];//b[]??????
	cout<<fei[a[0]-1];//??????????
	for (k=1;k<n1;k++)
	{
		b[k]=fei[a[k]-1];
		cout<<endl<<b[k];//????????????
    }
}
int main(int argc, char* argv[])
{
	int sz[100],i,n,a;
	scanf("%d",&n);
	sz[0]=1;
	sz[1]=1;
	for(i=2;i<100;i++){
        sz[i]=sz[i-1]+sz[i-2];
	}
	for(i=0;i<n;i++){
        scanf("%d",&a);
		printf("%d\n",sz[a-1]);
	}
	return 0;
}
int F_num[10000]; 
int main()
{
    int test_total,max = 0,test_site;
    int i,j,k;
    F_num[0]=1;
    F_num[1]=1;
    max = 1;
    scanf ("%d",&test_total);
    for (i=0; i<test_total; i++)
    {
        scanf ("%d", &test_site);
        if (max >= test_site)
        {
                printf("%d\n", F_num[test_site-1]);
        }
        else
        {
            for(j=max +1; j<=test_site; j++)
            {
                      F_num[j] = F_num[j-1]+F_num[j-2];
            }
            max = test_site;
            printf("%d\n", F_num[test_site-1]);
        }
    } 
    return 0;
}
int num[30]={0,1,1};
void fib()
{
for(int i=2;i<30;i++)
	num[i]=num[i-1]+num[i-2];	
	
}
int main()
{
	int n;
	cin>>n;
	fib();
	while(n--)
	{
		int a;
		cin>>a;
		cout<<num[a]<<endl;
	}
	return 0;
}
int main(){
	int n,i,j,x=1,y=1,z;
	cin>>n;
	int a[n];

	memset(a,0,sizeof(a));

	for(i=0;i<=n-1;i++){
		cin>>a[i];
	}
	for(i=0;i<=n-1;i++){
		x=1;y=1;
		for(j=1;j<=a[i];j++){
			z=x+y;
			x=y;
			y=z;
		}

		cout<<y-x<<endl;
	}
	return 0;
	}
main()
{
      int n,i;
      scanf("%d",&n);
      for(i=1;i<=n;i++)
      {
                       int m,j;
                       scanf("%d",&m);
          int a[1000];
          a[1]=1;
          a[2]=1;
          for(j=3;j<=m;j++)
           a[j]=a[j-1]+a[j-2];
          if(m==1||m==2)
          printf("%d",1);
          else
          printf("%d",a[m]);
          if(i<n)
          printf("\n");


          }
      
      getchar();
      
}
//??
//?????????????: ?????????????1????????????2?????
//???????a???????????a??????

//????
//?1?????????n?????n???????????1?????????a(1 <= a <= 20)

//????
//n????????????????????????????????a?????
int main()
{
	int f(int x);
	int n;
	cin>>n;
	int a[50];
	for(int i=1;i<=n;i++)
	{
		cin>>a[i];
		int z;
		z=f(a[i]);
		cout<<z<<endl;
	}
	return 0;
}
int f(int x)
{
	int count=2,sum1=1,sum2=1;
	if(x==1||x==2) sum2=1;
	else{
	do{
		int temp;
		temp=sum2;
		sum2=sum1+sum2;
		sum1=temp;

		count++;
	}while(count<x);
	}
	return sum2;
}
int main()
{
    int n;
    cin>>n;
    int s[20];
    s[0]=s[1]=1;
    for(int i=2;i<20;i++)
       {
           s[i]=s[i-1]+s[i-2];//???????????20???????????
       }
    int temp;//???????
    for(int j=0;j<n;j++)
       {
           cin>>temp;
           cout<<s[temp-1]<<endl;//???????????????
       }
    return 0;
}
int fib(int n);
int main(){
	int N;
	cin>>N;
	for(int i=0;i<N;i++){
		int n;
		cin>>n;
		cout<<fib(n)<<endl;
	}
	return 0;
}
int fib(int n){
	if(n==1||n==2) return 1;
	else return (fib(n-1)+fib(n-2));
}
int main(){
		int n,i,t;
		int a[50]={1,1};
		int b[100],c[100];
        for(i=0;i<48;i++)
			a[i+2]=a[i]+a[i+1];
		scanf("%d",&n);
		for(i=0;i<n;i++)
		{
			scanf("%d",&b[i]);
            t=b[i];
		    c[i]=a[t-1];
		}
           for(i=0;i<n;i++)
			   printf("%d\n",c[i]);
}
int main()
{
    int n,i,j,k,c;
    int a[21];
    scanf("%d",&n);
    
    for (j=1;j<=n;j++)
    {
      scanf("%d",&k);
      for(i=3;i<=k;i++)
      {
        a[1]=1;
        a[2]=1;                                    
       a[i]=a[i-1]+a[i-2];              
      }        
        c=a[k];
        printf("%d\n",c);        
    }
    getchar();
    getchar();
}
int main()
{
	int n,i,j,k,a[10000],b[30],c[10000];
	scanf("%d",&n);
	for (i=0;i<n;i++){
		scanf("%d",&a[i]);
	}
    for (i=0;i<n;i++){
		for (j=0;j<a[i];j++){
			b[0]=1;
			b[1]=1;
			b[j+2]=b[j]+b[j+1];
			c[i]=b[j];
		}
	}
	for (k=0;k<n;k++){
	    printf("%d\n",c[k]);
	}
	return 0;
}
int f(int);
int main()
{
	int n;
	cin >> n;
	for(int i=0; i < n; i++)
	{
		int a;
		cin>>a;
		cout<<f(a)<<endl;
	}
}
int f(int x)
{
	if(x==1)
	{
		return 1;
	}
	if(x == 2)
	{
		return 1;
	}
	return f(x-1)+f(x-2);
}
int f( int a)
{
    if (a<=2)
    return 1;
    else 
    return f(a-1)+f(a-2);
}
main()
{
      int a,b,c,d,i;
      scanf("%d",&a);
      for (i=0;i<a;i++)
      {
          scanf("%d",&b);
          printf("%d\n",f(b));
      }
      getchar ();
      getchar ();
}
int fibonacci(int n)
{
	int x;
	if(n==1||n==2){
		x=1;
	}
	else{
		x=fibonacci(n-1)+fibonacci(n-2);
	}
	return x;
}

int main()
{
	int n,i,m,a;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d",&a);
		m=fibonacci(a);
		printf("%d\n",m);
	}
	return 0;
}
int main()
{int i,a[20],m,n;
	scanf("%d",&n);
	a[0]=1;
	a[1]=1;
	for(i=2;i<20;i++)
		a[i]=a[i-1]+a[i-2];
	i=0;
	while(i<n)
	{	scanf("%d",&m);
		if(i==n-1)
			{printf("%d",a[m-1]);return 0;}
		else		
			printf("%d\n",a[m-1]);
i++;
	}
	return 0;
}
int num[MAX] = {0};
int f(int x)
{
	if( x == 1 || x == 2)
		return 1;
	return f(x-1) + f(x-2);
}
int main()
{
	int n = 0 ;
	cin>> n;
	while(n--)
	{
		int a = 0;
		cin>>a;
		cout<< f(a) <<endl;
	}
	return 0;
}
int feibonaqi(int N);
int main()
{
	int n;
	int j;
	int a[1000];
	
	scanf("%d", &n);

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

	for (j = 0; j <n; j++)
	{
		printf("%d\n", feibonaqi(a[j]));
	
	}

	return 0;
}

int feibonaqi(int N)
{	int F[1000];
	int i;

	F[0] = 1;
	F[1] = 1;

	for (i = 2; i < N; i++)
	{
		F[i] = F[i-1] + F[i-2];
	}

	return F[N-1];




}
main()
{
int a[10000];
int n,i,b;
scanf("%d",&n);
for(i=0;i<n;i++)
   {  int sum=0;
scanf("%d",&b);
    sum=fei(b);
    printf("%d\n",sum);
}
}

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

}
int main()
{
	int a[21];
	a[1]=1;
	a[2]=1;
	a[3]=2;
	a[4]=3;
	a[5]=5;
	a[6]=8;
	a[7]=13;
	a[8]=21;
	a[9]=34;
	a[10]=55;
	a[11]=89;
	a[12]=144;
	a[13]=233;
	a[14]=377;
	a[15]=610;
	a[16]=987;
	a[17]=1597;
	a[18]=2584;
	a[19]=4181;
	a[20]=6765;
	int n,j,i;
	scanf("%d",&n);
	for(i=1;i<=n;i++)
	{
		scanf("%d",&j);
		printf("%d\n",a[j]);
	}
	return 0;
}
int	fei(int k)
{
	int	f[21] = {0};
	f[1] = 1;
	f[2] = 1;
	int	i;
	for (i = 3; i <= 21; i ++)
	{
		f[i] = f[i - 1] + f[i - 2];
	}
	return f[k];
}
int main()
{
	int	i, n, a;
	cin >> n;
	
	for (i = 0; i < n; i ++)
	{
		cin >> a;
		cout << fei(a) << endl;
	}

	return 0;
}
int cmp(const void * p1, const void * p2)
{
	return 0;
}

int a[25];

int main()
{
	int n;
	cin >> n;
	a[0] = a[1] = 1;
	for (int i = 2; i < 21; i ++)
		a[i] = a[i - 1] + a[i - 2];

	int b;
	while (n --)
	{
		cin >> b;
		cout << a[b - 1] << endl;
	}


	return 0;
}
int f(int n)
{
int c;
if(n==1)
   c=1;
else if(n==2)
   c=1;
else
   c=f(n-1)+f(n-2);
return c;
}
void main()
{
int n,i;
scanf("%d",&n);
int a[100];
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
printf("\n");
}
for(i=0;i<n;i++)
printf("%d\n",f(a[i]));

}
int fibo(int x);
int main()
{
	int shuzu[N];
	int n,a,i;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d",&(shuzu[i]));
	}
	for(i=0;i<n;i++)
	{
		a=fibo(shuzu[i]);
		printf("%d\n",a);
	}
	return 0;
}

int fibo(int x)
{
	int p=1,q=1,temp,result,k;
	if((x==1)||(x==2))
	{
		result=1;
	}
	else
	{
		for(k=x;k>2;k--)
		{
			temp=q;
			q=q+p;
			p=temp;
		}
		result=q;
	}
	return result;
}
int F(int x)
{
	int k,t,a[25];
	a[1]=1;
	a[2]=1;
	if(x<3)
	
	{
		t=a[x];	
		return t;
	}
	else
	{
		for(k=3;k<21;k++)
		{
			a[k]=a[k-1]+a[k-2];	
		}
		t=a[x];	
		return t;	
	}
}
int main()
{
	int n,a,i;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d",&a);
		printf("%d\n",F(a));	
	}


	return 0;
}
int shulie(int n);
int main()
{
	int n,i,j,weizhi[100],jl[500]={0};
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d",&weizhi[i]);
	}
	for(i=0;i<n;i++)
	{
		jl[i]=shulie(weizhi[i]);
	}
	for(i=0;i<n;i++)
	{
		printf("%d\n",jl[i]);
	}
	return 0;
}
int shulie(int n)
{
	int i,shulie[500]={1,1};
	for(i=2;i<n;i++)
	{
		shulie[i]=shulie[i-1]+shulie[i-2];
	}
	return shulie[i-1];
}
int main ()
{
	int n,k,x;
	cin>>n;
	int a[n];
	int sum[n];
	for(k=0;k<n;k=k+1)
	{
		cin>>a[k];
int b[a[k]];
b[0]=1;
b[1]=1;
		for(x=2;x<a[k];x=x+1)
		{
			b[x]=b[x-1]+b[x-2];

			}
		sum[k]=b[a[k]-1];
	}
	for(k=0;k<n;k=k+1)
		cout<<sum[k]<<endl;
	return 0;






}
int main()
{int a[20]={1,1},i,n,c,b;

for(i=2;i<=20;i++)a[i]=a[i-1]+a[i-2];
cin>>n;
for(i=1;i<=n;i++){cin>>c;cout<<a[c-1]<<'\n';}

return 0;
}
/*
 * opkp.cpp
 *
 *  Created on: 2012-10-24
 *      Author: 1234
 */
int main()
{
	int n;
	int a,b,c;
	int m[50];
	a=b=c=1;
	cin>>n;
	for(int j=0;j<n;j++)
	{
		cin>>m[j];
		a=b=1;
		for(int i=0;i<m[j]-2;i++)
			{
				c=b;
				b=a+b;
				a=c;
			}
		cout<<b<<endl;
	}
}
int main()
{
	int Fibonacci(int n);int n,i,a[20];
	scanf("%d",&n);
	for(i=1;i<=n;i++)
		scanf("%d",&a[i-1]);
	for(i=1;i<=n;i++)
		printf("%d\n",Fibonacci(a[i-1]));
	return 0;
}

int Fibonacci(int n)
{
	int a;
	if(n==1) a=1;
	else
	if(n==2) a=1;
	else
	a=Fibonacci(n-1)+Fibonacci(n-2);
	return(a);
}
main()
{
      int n;
      scanf("%d",&n);
      int fb[29];
      fb[1]=1;
      fb[2]=1;
      int i;
      for(i=3;i<22;i++)
      {
          fb[i]=fb[i-1]+fb[i-2];
      }
      //for(i=1;i<21;i++)
      //   printf("%d ",fb[i]);
      for(;n>0;n--)
      {
          int a;
          scanf("%d", &a);
          printf("%d\n",fb[a]);         
      }
}
int Fibonacci(int x);
int main(){	
int n,s,k,a[25];	
scanf("%d",&n);	
for(k=0;k<n;k++){		
scanf("%d",&a[k]);
	}	
for(k=0;k<n;k++){	    
s=Fibonacci(a[k]);        
printf("%d\n",s);	
}	
return 0;
}
int Fibonacci(int x){	
int result,i,a=1,b=1,c;	
if(x<=2){		
result=1;	
}else{		
for(i=3;i<=x;i++){			
result=a+b;			
c=b;			
b=result;			
a=c;		
}	
}	
return result;}
/*
 * Fib.cpp
 *
 *  Created on: 2013-10-1
 *      Author: KEVIN
 */


int fibs[19];//????????????????????
int Fib(int i)
{
	if(fibs[i-1]!=0)return fibs[i-1];//????????????
	else
	{
                //?????????????
		if(i==1||i==2)
		{
			fibs[i-1]=1;
			return 1;
		}
		else 
		{
			fibs[i-1]=Fib(i-1)+Fib(i-2);
			return fibs[i-1];
		}
	}
}
int main()
{
	for(int i=0;i<=19;i++)fibs[i]=0;//???0
	int n;
	cin>>n;
	while(n)
	{
		int a;
		cin>>a;
		cout<<Fib(a)<<endl;
		n--;
	}
	return 0;
}
int F(int,int );
int F( int a , int b ) 
{
	int c = a + b ;
	a = b ;
	b = c ;
	return b ;
}


int main ()
{
	int n , i , j , x[101];
	cin >> n ;
	for ( i = 1 ; i <= n ; i ++)
	{
		cin >> x[i];
		if ( x[i] == 1 )
		{
			cout << "1" << endl ;
			continue ;
		}
		if ( x[i] == 2 )
		{
			cout << "1" << endl ;
			continue ;
		}
		int a = 1 , t , b = 1 , sum = 2; 
		do
		{ 
			t = b ; 
			b = F(a,b);
			a = t ;
			sum ++ ;
		}while (sum < x[i] );
		cout << b << endl ;		
	} 
}
int main(){
	int a[20],i,b[20],n;
	a[0]=1;a[1]=1;                                     //??????????
	for(i=2;i<20;i++){a[i]=a[i-1]+a[i-2];}             //???????????a[i]
	cin>>n;
	for(i=0;i<n;i++){cin>>b[i];cout<<a[b[i]-1]<<endl;}         //????????????
	return 0;
}
int main()
{
 int n;
 scanf("%d",&n);
 int dijige[20];
 for(int i=0;i<=n-1;i++)
  {
    scanf("%d",&(dijige[i]));
  }
 int q[30];
 q[0]=1;
 q[1]=1;
 for(int k=2;k<=25;k++)
   {
     q[k]=q[k-1]+q[k-2];
   }
 for(int j=0;j<=n-1;j++)
   { 
         printf("%d\n",q[dijige[j]-1]);
  
   } 
  
 return 0;
}
/*
 * febonacci.cpp
 *?? - ??????
??
?????????????: ?????????????1????????????2?????
???????a???????????a??????
????
?1?????????n?????n???????????1?????????a(1 <= a <= 20)
????
n????????????????????????????????a?????
????
4
5
2
19
1
????
5
1
4181
1
 *  Created on: 2013-9-27
 *      Author: ???
 */
int main()
{
	int x[20]={1,1};//feibonacci??
	for(int i=2;i<20;i++)
		x[i]=x[i-1]+x[i-2];
	int n=0;
	cin >> n;
	int a[n];
	for(int i=0;i<n;i++)
		cin >> a[i];
	for(int i=0;i<n;i++)
		cout << x[a[i]-1] << endl;
	return 0;
}
int main() {
	int n,a,i,p,q,result;
	scanf("%d",&n);
	while(n--){
		scanf("%d",&a);

		if((a==1)||(a==2)){
			printf("1\n");
		}

		else{
			p=1;
			q=1;
			for(i=2;i<a;i++){
				result=p+q;
				p=q;
				q=result;
			}
			printf("%d\n",result);
		}

	}
	return 0; 
}
/*
 * Fibonacci.cpp
 *
 *  Created on: 2012-10-17
 *      Author: Cui Zhaoxiong Class4 1200012931
 */
int main(){
	int array[20];
	array[0]=1;
	array[1]=1;
	for (int i=2;i<20;i++){
		array[i]=array[i-1]+array[i-2];
	}										//????????
	int n=0;
	cin >>n;
	for (int i=1;i<=n;i++){
		int p=0;
		cin >>p;
		cout <<array[p-1] <<endl;			//??????????
	}
	return 0;
}
int main()
{
    int n;
    int a[21];
    a[1]=1;
    a[2]=1;
    for(int i=3;i<=20;i++)
    a[i]=a[i-1]+a[i-2];
    scanf("%d",&n);
    int b[n];
    for(int i=0;i<n;i++)
   { scanf("%d",&b[n]);
    printf("%d\n",a[b[n]]);}
    getchar();
    getchar();
}
int main(int argc, char* argv[])
{
	int sz[100];
	int m;
	int sum=0;
	scanf("%d",&m);
	int shuru[100];
	for(int i=0;i<m;i++)
	{
		scanf("%d",&(shuru[i]));
	}
	for(int h=0;h<m;h++)
	{
		
	for(int j=0;j<shuru[h];j++)
	{
		if(j<=1)
		{
			sz[j]=1;
		}
		if(j>=2)
		{
			sz[j]=sz[j-1]+sz[j-2];
		}
		sum=sz[j];
	}
	printf("%d\n",sum);

	}

	return 0;
}
int main(int argc, char* argv[])
{
	int n,i,j;
	scanf("%d",&n);
	int a[1000];
    for(i=0;i<n;i++){
		scanf("%d",&a[i]);
	}
	int y[30];
	for(i=0;i<n;i++){
	  for(j=0;j<a[i];j++){
		if(j==0){
			y[0]=1;
		}else if(j==1){
			y[1]=1;
		}else{
			y[j]=y[j-1]+y[j-2];
		}
	  }
       printf("%d\n",y[j-1]);
	  
	}
	
	return 0;
}
int f(int a)
{
	int d[20]={1,1};
	int i;
	for(i=2;i<a;i++)
		d[i]=d[i-1]+d[i-2];
	return(d[a-1]);
}

int main()
{
	int a[20],i,z[20],n;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d",&a[i]);
	}
	for(i=0;i<n;i++)
	{
		z[i]=f(a[i]);
		printf("%d\n",z[i]);
	}
	return 0;
}
int main()
{
	int n,i,j,a[20],b[20];
	a[0]=a[1]=1;
	for(i=2;i<20;i++)
		a[i]=a[i-1]+a[i-2];
	scanf("%d",&n);
	for (i=0;i<n;i++)
	{
		scanf("%d",&b[i]);
	}
	for (i=0;i<n;i++)
	{
		for (j=1;j<21;j++)
		{
			if(b[i]==j)
				printf("%d\n",a[j-1]);
		}
	}
	return 0;
}
int fib(int a)
{
	if (a == 1 || a == 2)
	{
		return 1;
	}
	return fib(a - 1) + fib(a - 2);
}

int main()
{
	int a, i, n;
	cin >> n;
	for (i = 0; i < n; i++)
	{
		cin >> a;
		cout << fib(a) << endl;
	}
	cout << endl;
	return 0;
}
int main(){
   int n;
   scanf("%d",&n);
   int a[20];
   int i,m,r,s,t;
   for(i=0;i<n;i++){
		 scanf("%d",&a[i]);
   }
   int sz[20];
   for(i=0;i<20;i++){
    	 if(i==0){
		     sz[i]=1;
		 }else if(i==1){
			 sz[i]=1;
		 }else{
			 r=sz[i-1];
			 s=sz[i-2];
			 t=r+s;
			 sz[i]=t;
		 }
   }
   for(i=0;i<n;i++){
    	 if(i==n-1){
		     m=a[i];
		     printf("%d",sz[m-1]);
			 m=0;
		 }else{
			 m=a[i];
		     printf("%d\n",sz[m-1]);
			 m=0;
		 }
	}
	return 0;
}
int main()
{
    int f(int n);
    int n,a,i;
    scanf("%d",&n);
    for(i=0;i<n;i++)
      {
        int s;
        
        scanf("%d",&a);
        s=f(a);
        printf("%d\n",s);
        }
     getchar();
     getchar();
}
int f(int n)
{
    int z;
    if(n==1||n==2)
      z=1;
     else
     z=f(n-1)+f(n-2);
     return(z);
}
/*
 *??????????.cpp
 *??????
 *?????2012-10-15
 *??????????a???????????a??????
 */

int main ()
{
	int n,a,i,j,a1 = 1,a2 = 1,a3;//??????n;???a;????i,j;?a-2????a-1???a1,a2?????1??a??a3
	cin >> n;//???????n
	for (i = 1; i <= n; i++)//???????
	{
		cin >> a;//???????a
		if ( a == 1 || a == 2)//???1?2??????1
			cout << "1" << endl;
		else//?a>=3???????i?a3
		{
			for (j = 3; j <= a; j++)//????a3
			{
				a3 = a1 + a2;//a3???????
				a1 = a2;//?????j+1???a2???j-2?
				a2 = a3;//a3??j-1??
			}
			cout << a3 << endl;//????
			a1 = 1;//??a1,a2???????????
			a2 = 1;
		}
	}
	return 0;
}