semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int fabo(int k);
int main()
{
    int n,k;
    cin>>n;
    while(n>0)
    {
        cin>>k;
        cout<<fabo(k)<<endl;
        n--;
    }
    return 0;
}
int fabo(int k)
{
    if(k==1)
        return 1;
    if(k==2)
        return 1;
    else
        return fabo(k-1)+fabo(k-2);
}
void main(){
	int n,a[10050];
	int i,j,num;
	scanf("%d",&n);
	a[1]=1;a[2]=1;
	for(j=1;j<10000;j++){
		a[j+2]=a[j+1]+a[j];
	}
	for(i=0;i<n;i++){
		scanf("%d",&num);
		if(num==0)
			printf("0\n");
		else if(num==1)
			printf("1\n");
		else
			printf("%d\n",a[num]);
	}
}
int main()
{
    int n,i,j,k,s,a,b;
    scanf("%d",&n);
    for(i=1;i<=n;i++)
    {
      scanf("%d",&k);
      if(k==1||k==2)
      {
        printf("1\n");
        continue;
        }
        else
        {
          a=1;
          b=1;  
        for(j=3;j<=k;j++)
        {
           s=a+b;
           a=b;
           b=s;
           }
           printf("%d\n",s);
           }
           }
           getchar();
           getchar();
           }
int main()
{
  int f[20]={1,1};//f????????fibonacci
  int g[20];//g???????????
  int i=2;
  for(i=2;i<=20;i++)
  {
	f[i]=f[i-2]+f[i-1];
  }                 //????????
  int n,a;
  cin>>n;              // n???????,a???????????
     for(int j=1;j<=n;j++)
    {
	 cin>>a;
	 g[j]=f[a-1];//f??0???????????????a???????
	 }
     for(int k=1;k<=n;k++)
     {
    	 cout<<g[k]<<endl;//?????
     }
  return 0;
}
int f(int n){
    int k;
    if(n==1||n==2) k=1;
    else{
        k=f(n-2)+f(n-1);
        }
    return k;
    }
int main(){
    int t,n,i,j;
    scanf("%d",&t);
    for(j=0;j<t;j++){
        scanf("%d",&n);
        i=f(n);
        printf("%d\n",i);
        }
    
    
    scanf("%d",&i);
    return 0;
    }
int main(){
	int n,i,m,t,p,s;
	int a[100],b[100];
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d",&a[i]);
		m=1;
		t=1;
		for(s=3;s<=a[i];s++){
			p=t;
			t=t+m;
			m=p;
		}
		b[i]=t;
	}
	for(i=0;i<n;i++){
		printf("%d\n",b[i]);
	}
	return 0;
}
int F(int n)
{
    int f;
    if(n==1||n==2)
    {
        f=1;
    }
    else
    {
        f=F(n-1)+F(n-2);
    }
    return (f);
}
int main()
{
    int n,i,a;
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
        scanf("%d",&a);
        printf("%d\n",F(a));
    }
    return 0;
}
int main()
{
 int n,i,j;
 int a[10000],b[10000];
 scanf("%d",&n);
 for(i=0;i<n;i++)
  scanf("%d",&b[i]);
 a[0]=1;
 a[1]=1;
 for(i=0;i<n;i++)
 {
  for(j=2;j<=b[i]-1;j++)
  a[j]=a[j-1]+a[j-2];
  printf("%d\n",a[b[i]-1]);                
 }
 getchar();
 getchar();
 return 0;  
}
int main()
{
    double a=1,b=1,l=(1+sqrt(5))/2,m=(1-sqrt(5))/2,c;
    int i,n,k,h,an;
    cin >> h;
    for(k=1;k<=h;k++)
   {
       cin >> n;
       a=1;b=1;
    for(i=1;i<=n;i++)
    {
                    
                     a=a*l;
                     b=b*m;
                     }
    c=(a-b)/(l-m);
    cout << c << endl;
   }
   return 0;
}
int main(){
    int n,i,a,tuzhi[25];
    scanf("%d",&n);
    tuzhi[0]=1;
    tuzhi[1]=1;
    for(i=2;i<25;i++){
           tuzhi[i]=tuzhi[i-1]+tuzhi[i-2]; 
    }          
    for(i=0;i<n;i++){
           scanf("%d",&a);
           printf("%d\n",tuzhi[a-1]);
    }
    scanf("%d",&n);
    return 0;
}
/*
 * ??????.cpp
 *
 *  Created on: 2012-10-19
 *      Author: ??
 *      ?????????a?????
 */


int main(){
	int a[21];              //????a[21]
	int i=0,j=0,n=0;        //????

	cin>>n;                 //??????????n

	a[1]=1;
	a[2]=1;                 //?a[1],a[2]????

	for(i=3; i<=20 ;i++)
	    a[i]=a[i-1]+a[i-2]; //?a[i]????

	for(j=1; j<=n ;j++)
	  { cin>>i;
	    cout<<a[i]<<endl;
	  }                     //??n???

	return 0;
}
main()
{
      int n,a[20],b[20],i,j;
      scanf("%d",&n);
      printf("\n");
      for(i=1;i<=n;i++)
      {
      scanf("%d",&a[i]);
      printf("\n");
      }
      b[1]=1,b[2]=1;
      for(j=3;j<=20;j++)
      b[j]=b[j-1]+b[j-2];
       for(i=1;i<=n;i++)
       {
       printf("%d\n",b[a[i]]);
       printf("\n"); 
       }
        getchar();
        getchar();
        }
int F(int n);
int main(){
	int n,m,result;
	scanf("%d", &m);
for(int k=0;k<m;k++){
scanf("%d", &n);
	result = F(n);
	printf("%d\n", result);
}
	return 0;
}

  int F(int n){
	  int c=0;
if(n==0)      return 0;
if(n==1||n==2)      return 1;
if(n>2){
	int a=1,b=1,c=0;
for(int i=2;i<n;i++){
c=a+b;
a=b;
b=c;
}

return c;}
  }
int main()
{
	int f(int a);
	int i,n,c;
	cin>>n;
	for(i=1;i<=n;i++)
	{cin>>c;
	cout<<f(c)<<endl;}
	return 0;
}

int f(int a)
{
	int b;
	if(a<0) {cout<<"error";b=-1;}
	else if (a==1||a==2) b=1;
	else b=f(a-1)+f(a-2);
	return b;
}
int main()
{
    int n,i,a[1000],b[100];
    scanf("%d",&n);
    a[1]=1;
    a[2]=1;
    for(i=1;i<=n;i++)
    {
                     scanf("%d",&b[i]);
    }
    for(i=3;i<=1000;i++)
    {
                                             a[i]=a[i-1]+a[i-2];
    }
    for(i=1;i<=n;i++)
    {
         printf("%d\n",a[b[i]]);
    }
         getchar();
         getchar();
         getchar();
}
int main()
{
	int k,i,j,a,m=1,n=1,temp;
	scanf("%d",&k);
	int * sum= (int *)malloc(sizeof(int)*k);
	for(i=0;i<k;i++)
	{
		scanf("%d",&a);
		if(a==1||a==2)
			sum[i]=1;
		else
		{
		m=1;n=1;
		sum[i]=0;
		for(j=1;j<=a-2;j++)
		{
			sum[i]=m+n;
			m=n;
			n=sum[i];
		}
		}
	}
	for(i=0;i<k;i++)
		printf("%d\n",sum[i]);
	return 0;
}
int a[25];
int fact(int b)
{
	if(b==1)
	{
		a[1]=1;
		return a[1];
	}
	else if(b==2)
	{
		a[2]=1;
		return a[2];
	}
	else
	{
		a[b]=fact(b-1)+fact(b-2);
		return a[b];
	}
}

int main()
{
	int n;
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		int p;
		cin>>p;
		cout<<fact(p)<<endl;
	}
	return 0;
}
int s(int n);
int main()
{
	int n[1000],k,j;
	scanf("%d",&k);
	for(j=0;j<k;j++){
		scanf("%d",&n[j]);
	}
	for(j=0;j<k;j++){
		printf("%d\n",s(n[j]));
	}
	return 0;
}
int s(int n){
	int x,y,z,i;
	scanf("d",&n);
	x=1;
	y=1;
	z=x+y;
	for(i=3;i<n;i++){
		x=y;
		y=z;
		z=x+y;
	}
	if(n<3){
		z=1;
	}
	return z;
}
int main()
{
	int test[1000000];
	int num, i, j;
	cin>>num;
	int f[30]= {1,1,1};
	int cur;
	for(i = 3; i < 21; i ++)
	{
		f[i] = f[i-1] + f[i-2];
	}
	for(i = 0 ; i < num ; i++)
	{
		cin>>cur;
		cout<<f[cur]<<endl;;
		;
	}
	return 0;
}
int f(int n)
{
    if(n==1)
    return 1;
    if(n==2)
    return 1;
    return (f(n-1)+f(n-2));
}
int main()
{
    int n,i,a;
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
         scanf("%d",&a);
         printf("%d\n",f(a));
    }
    getchar();
    getchar();
}
int fbn(int);
int main(){
	int n;
	cin>>n;
	int i=0,a[1000];
	for(i=0;i<n;i++)
		cin >> a[i];
	for(i=0;i<n;i++)
		cout<<fbn(a[i])<<endl;
	return 0;
}
int fbn(int n)
{
	int c;
	if(n==1||n==2)c=1;
	else c=fbn(n-1)+fbn(n-2);
	return c;
}
/*
 * 8.cpp
 *??????
 *  Created on: 2012-10-15
 *      Author: ???
*/
int main()
{
	int n,a;//????
	cin>>n;//??
	for(int i=1;i<=n;i++)//??for??
	{
		cin>>a;
		int x1=1,x2=1,t;
		for(int k=2;k<a;k++)//??for??
		{
			t=x2;
			x2=x2+x1;
			x1=t;//?????????????????
		}
		cout<<x2<<endl;//??
	}
}
int main()
{
	int n;
	int a[100000],b[100000];
	int i,j;
	scanf("%d",&n);	
	for(i=1;i<100000;i++)
	{
		if(i==1)
			b[i]=1;
		if(i==2)
			b[i]=1;
		if(i>2)
			b[i]=b[i-2]+b[i-1];
	}
	for(i=0;i<n;i++)
	{scanf("%d",&a[i]);
	}
    for(i=0;i<n;i++)
	{
		j=a[i];
		printf("%d\n",b[j]);
	
	}



	return 0;
		
		
		
		
	


}
int f(int x)
{
    if(x==1)return 1;
    else if(x==2)return 1;
    else 
    return f(x-2)+f(x-1);
}
main()
{
    int n,i;
    int a[10];
    scanf("%d",&n);
    for(i=0;i<n;i++)
    scanf("%d",&a[i]);
    for(i=0;i<n;i++)
    printf("%d\n",f(a[i]));
}
int a[30] = {0};
int fibo(int n)
{
	if(a[n] != 0)
		return a[n];
	return fibo(n-1)+fibo(n-2);
}
int main()
{
	a[1] =1;
	a[2] = 1;
	
	int n;
	cin>>n;
	while(n--)
	{
		int k;
		cin>>k;
		cout<<fibo(k)<<endl;
	}
	return 0;
}
//****************************************
//*?????????                   **
//*?????? 1100012763              **
//*???2011.9.29                      **
//****************************************
int main() 
{
	int n , i , a;
	int feibo[20];

    feibo[0] = 1;                                    //????????
	feibo[1] = 1;
	for (i = 2; i <= 19; i++)
		feibo[i] = feibo[i - 1] + feibo[i - 2];

	cin >> n;
	for (i = 1; i <= n; i++)
	{
		cin >> a;
		cout << feibo[a-1];
		if (i != n)
			cout << endl;
	}

	return 0;
}
/*
 * Homework3.5FibonacciSequence.cpp
 *
 * ?????????????: ?????????????1????????????2?????
 * ???????a???????????a??????
 *  Created on: 2013-10-27
 *      Author: JuiceHe
 */
int main()
{
   int str[50]={1,1},num[20];int n,i;
   for(i=2;i<50;i++)
	   str[i]=str[i-1]+str[i-2];//????????
   cin>>n;//????n
   for(i=0;i<=n-1;i++)
	   cin>>num[i];//??n????????n???
   for(i=0;i<=n-1;i++)
	   cout<<str[num[i]-1]<<endl;//?????????????

   return 0;
}
int main()
{
	int n, i, j, t1, t2,t;
	cin >> n;
	int a[21],b[21];
	for(i = 0; i < n; i ++)
		cin >> a[i];
	for(i = 0; i < n; i++)
	{
		b[i] = 0;
		for(j = 1; j <= a[i]; j ++)
		{
			if(j == 1 || j == 2)
			{
				t1 = 1;
				t2 = 1;
			}
			else
			{
				t = t1;
				t1 = t2;
				t2 = t2 + t;
			}
		}	
		b[i] = t2;
		cout << b[i] << endl;
	}
	return 0;
}
int main() {
	int n;
	cin >>n;
	const int x=n;
    int a[x];
    for (int i=0;i<=x-1;i=i+1)
    	cin >>a[i];
    int max=0;
    for (int ii=0;ii<=x-1;ii++)
    {
    	if (a[ii]>max)
    		max=a[ii];
    }
    int b[max];
    b[0]=1;
    b[1]=1;
    for (int j=2;j<=max-1;j=j+1)
    	b[j]=b[j-1]+b[j-2];
    for (int k=0;k<=x-1;k=k+1)
    {
    	int t=a[k]-1;
        cout <<b[t]<<endl;
    }
return 0;
}
int fib(int n)
{
   int i,s;
   if(n==1||n==2)
    s=1;
   if(n>2)
  {
   s=fib(n-1)+fib(n-2);
  }
  return s;
}
int main()
{
   int n;
   int a[100000];
   scanf("%d",&n);
   for(int i=0;i<n;i++)
  {
   scanf("%d",&a[i]);
  }
  for(int i=0;i<n;i++)
  printf("%d\n",fib(a[i]));
  getchar();
  getchar();
}
int fb(int x);
int main(){
    int n,i,b;
    int a[20];
    scanf("%d",&n);
    for(i=0;i<n;i++){
                    scanf("%d",&a[i]);                  
    }
    for(i=0;i<n;i++){
                     b=fb(a[i]);
                     printf("%d\n",b);                 
    }
    return 0;                   
}
int fb(int x){
              int y=1,z=1,c,i;
              if(x==1||x==2){
                             c=1;               
              }
              else{
              for(i=2;i<x;i++){
                                c=y+z;
                                y=z;
                                z=c;
                                                  
              }
              }
     return c;         
    }
/*
 * feibunaqishulie.cpp
 *
 *  Created on: 2012-10-21
 *      Author: 1200012791??
 *      ????????????????: ?????????????1????????????2????? ???????a???????????a??????
 */
int main(){
	int n=0,i=0,j=0,p=0,q=0,r=0; //??6???????????0
	cin>>n; //??n
	int a[n],b[n]; //??????
	for(;i<n;i++) cin>>a[i]; //????a[n]????
	for(;j<n;j++){ //????
		p=0; //?????
		q=1; //?????
		for(b[j]=0;b[j]<a[j]-1;b[j]++){ //1?a[j]-1????
			r=p; //????????r
			p=q; //???????????
			q+=r; //?????
		}
		cout<<q<<endl; //?????n??
	}
	return 0;
}
int p(int m)
{
	if(m==1)return 1;
	else if(m==2)return 1;
	else return p(m-1)+p(m-2);
}
int main()
{
	int n;
	cin>>n;
	int a[n];
	for(int i=0;i<n;i++)cin>>a[i];
	for(int i=0;i<n;i++)cout<<p(a[i])<<endl;
return 0;}
int f(int af)
{
	if(af == 1 || af == 2)
		return 1;
	return f(af-1) + f(af-2);
}
int main()
{
	int n, m, k;
	cin >> n;
	for (int i = 1; i <= n; i++)
	{
		cin >> k;
		m = f(k);
		cout << m << endl;
	}
	return 0;
}
int main()
{
	int n,F[25];
	int i;
	for(i=1;i<=20;i++)
	{
		if(i==1 || i==2)
			F[i] = 1;
		else
			F[i] = F[i-1]+F[i-2];
	}
	cin>>n;
	while(n>0)
	{
		n--;
		int a;
		cin>>a;
		cout<<F[a]<<endl;
	}
	return 0;
}
int main()
{
	int n;
	int a;
	int i,f[21];

	cin >> n;
	while(n--)
	{
		cin >> a;
		f[1] = 1;
		f[2] = 1;
		if(a >=3)
		{
			for(i = 3; i <=a; i++)
				f[i] = f[i-1] + f[i-2];
		}
		cout << f[a] << endl;
	}
}
/*
 * ???008.cpp
 * Created on: 2012-10-14
 * Author: ???
 * ?????????
 */
int main(){
	int n,i=1,j=3;              //??n i j???
	int b[20];                //????
	b[1]=1,b[2]=1;          //??????1
	while(j<=20){           //????
	b[j]=b[j-1]+b[j-2];     //???????
	j=j+1;                  //?j?1
}
    cin>>n;                 //??n
    int a[n];               //??????
	while(i<=n){            //????
	cin>>a[i];              //?????????
	cout<<b[a[i]]<<endl;    //??????a??
	i=i+1;                  //?i?1
	}
	return 0;               //????
}
void main(){
	int sz1[20],sz2[20];
	int i,n,j,b,s=0;
	scanf("%d",&n);
	sz1[0]=sz1[1]=1;
	for(i=2;i<20;i++){
		sz1[i]=sz1[i-1]+sz1[i-2];
	}
	for(i=0;i<n;i++){
		scanf("%d",&b);
		sz2[i]=sz1[b-1];

	}
	for(i=0;i<n;i++){
	printf("%d\n",(sz2[i]));
	}
	
}
int main(){
	int n,i=0;
	cin>>n;
	int iNum[n-1];
	while(i<=(n-1)){
		cin>>iNum[i];
		i=i+1;
	}
	i=0;
	while(i<=(n-1)){
		int x1=1,x2=1,x3,j=3;
		if(iNum[i]<=2){
			cout<<1;
		}
		else {
			while(j<=iNum[i]){
				x3=x2+x1;
				x1=x2;
				x2=x3;
				j=j+1;
		}
			cout<<x2<<endl;			
		}
		i=i+1;
	}
	return 0;
}
int F(int n);

int main(){
	int a,n[20],r=0,m[20],i;
	scanf("%d",&a);
	for(i=0;i<a;i++){
		scanf("%d",&n[i]);
	}
	for(i=0;i<a;i++){
		m[i]=F(n[i]);
		printf("%d\n",m[i]);
	}
	return 0;
}

		
int F(int n){
	int a=1,b=1,j,r;
	if(n==1){
		r=1;
	}
	if(n==2){
		r=1;
	}
	for(j=2;j<n;j++){
		
		r=a+b;
		a=b;
		b=r;
		
	}
	return r;
}
int main()
{
	int a[10],n,c=0,b=1,f=1;
	int i,d,e,p;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d",&a[i]);
	}
	for(i=0;i<n;i++)
	{
	if(a[i]==1||a[i]==2)
		printf("1");
	else
	{
	for(p=2;p<a[i];p++)
	{
		c=f+b;
		e=c;
		d=b;
		b=e;
		f=d;
	}
	printf("\n%d\n",c);
	c=0;
	b=1;
	f=1;
	} 
	}
	return 0;
}
void main()
{	
	int n, i, b[50];
	int f(int);
	scanf("%d",&n);
	for(i=1; i<=n; i++)
	{
		scanf("%d",&b[i]);
	}
	for(i=1; i<=n; i++)
	{
		printf("%d\n",f(b[i]));
	}
}
int f(int x)
{
	if(x!=1 && x!=2)
	{
		return(f(x-1)+f(x-2));
	}
	if(x==1 || x==2) return 1;
	return 0;
}
int main()
{
	int i,j,n,a[20],number=0,e=0,f=1,g=0;
	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++)
		{
			number=e+f;
			g=e;
			e=number;
			f=g;
			
		}
		printf("%d\n",number);
		number=0;
		e=0;
		f=1;
	}
	return 0;
}
int main()
{
 int res[10000]={0,1},i,n,a,j,b[10000]={0};
 scanf("%d",&n);
 for(i=1;i<=n;i++){
  scanf("%d",&a);
  for(j=2;j<=a;j++){
   res[j]=res[j-1]+res[j-2];
  }
  b[i]=res[a];
 }
 for(i=1;i<=n;i++){
  printf("%d\n",b[i]);
 }
 return 0;
}
int main()
{
	int feb(int x);
	int n,a;
	cin >> n;
	int b[n];
	for (int i=0;i<n;i++)
	{
		cin >> a;
		b[i]=feb(a);
	}
	for (int i=0;i<n;i++)
	{
	cout << b[i] << endl;
	}
	return 0;
}

int feb(int x)
{
	int p=1,q=1,w;
    if (x>=3)
	for (int i=3;i<=x;i++)
	{
		w=p+q;
		p=q;
		q=w;
	}
	else
	w=1;
	return w;
}
int feibonaqi(int a)
{
  int i,sz[21];
  sz[0]=1;
  sz[1]=1;
  for(i=2;i<a;i++)
  {
    sz[i]=sz[i-1]+sz[i-2];
  }
  return sz[a-1];
 } 

int feibonaqi(int a);    
int main()
{
  int n,result[21],i,a;
  scanf("%d", &n);
  for(i=0;i<n;i++)
  {
    scanf("%d", &a);
    result[i]=feibonaqi(a);
  }
  for(i=0;i<n;i++)
  {
    printf("%d\n", result[i]);
  }
scanf(" ");
return 0;
}
int main()
{
	int n, k;
	int a, b, c;
	int i, j;
	cin >> n;
	for (i = 0; i < n; i++)
	{
		a = b = 1;
		cin >> k;
		if (k == 1 || k == 2)
			cout << "1" << endl;
		for (j = 3; j <= k; j++)
			{
				if (j % 3 == 0)
				{
					c = a + b;
					if (j == k)
						cout << c << endl;
				}
				if (j % 3 == 1)
				{
					a = b + c;
					if (j == k)
						cout << a << endl;
				}
				if (j% 3 == 2)
				{
					b = a + c;
					if (j == k)
						cout << b << endl;
				}
			}
	}
	return 0;
}
int main()
{   int n;
    int a[100],b[100];
	int i;
	int t;
	a[0]=1;
	a[1]=1;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{  scanf("%d",&b[i]);}
	for(i=2;i<99;i++)
	{  a[i]=a[i-1]+a[i-2];}
	for(i=0;i<n;i++)
	{  if(b[i]==1||b[i]==2)
	   { printf("1\n");}
	   else
	   {  t=b[i]-1;
	   printf("%d\n",a[t]);}}
	return 0;
}
int f(int x)
{
    int s;
    if(x==1||x==2)
    {
        s=1;
    }
    else
    {
        s=f(x-1)+f(x-2);
    }
    return s;
}
main()
{
    int n,i;
    int a[25];
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
        scanf("%d",&a[i]);
        if(a[i]==1||a[i]==2)
        {
            printf("1\n");
        }
        else
        {
            printf("%d\n",f(a[i]));
        }
    }
}
int main()
{
	int a[20],b[20],i,n;
	a[0]=0,a[1]=1,a[2]=1;
	for(i=0;i<=20;i++) a[i+2]=a[i+1]+a[i];
	cin>>n;
	for(i=0;i<=n-1;i++) cin>>b[i];
	for(i=0;i<=n-1;i++) cout<<a[b[i]]<<endl;
	return 0;
}
int main()
{
int a[101],i,j,k;
a[1]=1;
a[2]=1;
for(i=3;i<=100;i++)
{
a[i]=a[i-1]+a[i-2];
}
int n;
cin>>n;
for(j=1;j<=n;j++)
{
cin>>k;
cout<<a[k]<<endl;
}
return 0;
}
int f(int n){ 
	int c;
	if (n==1){
	c=1;
	}
	if (n==2){
		c=1;
	}
	if (n>2){
		int a=1;
		int b=1;
        for (int i=1;i<n-1;i++){
			c=a+b;
			a=b;
			b=c;
		}
	}
return c;
}
int main(){
int n,sz[21],i;
scanf ("%d",&n);
for (i=0;i<n;i++){
   scanf ("%d",&sz[i]);
}
for (i=0;i<n;i++){
printf ("%d\n",f(sz[i]));
}
return 0;
}
//********************************
//*???2.cpp   **
//*?????? 1200012768 **
//*???2013.1.10  **
//*?????????  **
//********************************
int fun(int a)
{
	if (a <= 2)
		return 1;
	return fun(a - 1) + fun(a - 2);
} 
int main()
{
	int n, a;
	cin >> n;
	while (n--)
	{
		cin >> a;
		cout << fun(a) << endl;
	}
	return 0;
}
int main(){
int n,i,m,j,d;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
       scanf("%d",&m);
	   if( m == 1 || m == 2 )
	   {
		   printf("%d\n",1);
		   continue;
	   }
	   int a = 1;
	   int b = 1;
	   for( j = 3; j <= m; j++ )
	   {
		   d = a + b;
		   a = b;
		   b = d;
	   }
	   printf("%d\n", d );
	}
	return 0;

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

int main ()
{
	int n,a,b,c,i,j,k;
	cin >> n;
	for (b = 1; b<= n; b++)
	{
		cin >> a;
		if (a == 1 || a == 2)
			cout << "1" << endl;
		else
		{
			i = 1;
			j = 1;
			for (c = 2; c < a; c++)
	        {
				k = f(i,j);
				i = j;
				j = k;
			}
			cout << j << endl;
		}
	}
	    return 0;
}
int fibonacci[1000] = {0, 1, 1};

int f(int n)
{
    if (fibonacci[n] > 0)
    {
        return fibonacci[n];
    }
    return f(n - 1) + f(n - 2);
}
int main()
{
    int k, n;
    cin >> k;
    while (k--)
    {
        cin >> n;
        cout << f(n) << endl;
    }
    return 0;
}
/*
 * ??????.cpp
 *
 *  Created on: 2012-10-16
 *      Author: ???
 */
int main()
{
	int a,b,c,n,i,j=3;

	cin >> n;
	for(i = 1;i <= n;i++)//???????????
	{
		cin >> c;
		if((c ==1)&&(c == 2))
			cout << 1;
		a = 1;
			b = 1;
		for(j = 3;j <= c;j = j +2 )//??????????
		{
			a = a+b;
			b = b+a;

		}
		if(c%2==1)//????a??b?
		cout << a<<endl;
		if(c%2==0)
			cout << b << endl;

	}
	return 0;
}
int feibo(int a);
int main()
{
	int k,sz[100],i,szresult[100];
	sz[100]=0;
	scanf("%d",&k);
	for(i=0;i<=k-1;i++)
	{
		scanf("%d",&sz[i]);
	}
	for(i=0;i<=k-1;i++)
	{
		szresult[i]=feibo(sz[i]);
	}
	for(i=0;i<=k-1;i++)
	{
		printf("%d\n",szresult[i]);
	}
	return 0;
}
int feibo(int a)
{
	int result,i,result1,result2;
	if(a<=2)
	{
		result=1;
		return result;
	}
	else{
		result1=1;
		result2=1;
		for(i=1;i<=a-2;i++)
		{
			result=result1+result2;
			result1=result2;
			result2=result;
		}
		return result;
	}
}
/*
 *  5   1009.cpp
 *
 *  Created on: 2013-10-9
 *      Author: weng
 *      ?????????????: ?????????????1?
 *      ???????????2?????
 *      ???????a???????????a??????
 *      ????
 *      ?1?????????n?????n????
 *      ???????1?????????a(1 <= a <= 20)
 *      ????
 *      n?????????????
 *      ???????????????????a?????
 */



int main()
{
	int a[20],i=2,k=0,n;
	cin>>n;
	int b[n],j=0;
	while(j<n)
	{
		cin>>b[j];
		j++;
	}
	a[0]=1;
	a[1]=1;
	while(i<=19)
	{
		a[i]=a[i-1]+a[i-2];
		i++;
	}
	while(k<n)
	{
		cout<<a[(b[k]-1)]<<"\n"<<endl;
		k++;
	}

return 0;
}
int main()
{int a[20];
int n;
cin>>n;
int f[21];
  f[1]=1;
  f[2]=1;

       for(int j=3;j<=20;j++)
    	   f[j]=f[j-1]+f[j-2];
       for(int i=0;i<n;i++)
           	   cin>>a[i];

       for(int i=0;i<n;i++)
cout<<f[a[i]]<<endl;
	return 0;

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

	return 0;
}
int main()
{
	int b,d[100],i=0;
	int a[21]={1,1,2,3,5,8,13,21,34,55,89,144,233,377,610,987,1597,2584,4181,6765};
	scanf("%d",&b);
	for(i=0;i<b;i++)
	{
		scanf("%d",&d[i]);
	}
	i=0;
	for(i=0;i<b;i++)
	{
		printf("%d\n",a[d[i]-1]);
	}
	return 0;
}
int main()
{
	int fei[20],n,i;
	int input[20],output[20];
	fei[0]=1;
	fei[1]=1;
	for(i=2;i<20;i++)
	{
		fei[i]=fei[i-1]+fei[i-2];
	}
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d",&input[i]);
		output[i]=fei[input[i]-1];
	}
	for(i=0;i<n;i++)
	{
		printf("%d\n",output[i]);
	}
	return 0;
}
int fib(int n)
{
    if (n<=1) 
    return n;
    else
    return fib(n-2)+fib(n-1);
}
main()
{
      int n;
      scanf ("%d",&n);
      int a;
      for (int i=0;i<n;i++)
      {
          scanf ("%d",&a);
          printf ("%d\n",fib(a));
      }
}
int main(){
  int n;
  scanf("%d",&n);
  for(int i=1;i<=n;i++){
    int a;
    scanf("%d",&a);
    if(a==1||a==2){
      printf("1\n");
    }else{
      int x=1,y=1,z;
      for(int m=3;m<=a;m++){
         z=x+y;
         x=y;
         y=z;
      }
      printf("%d\n",y);
    }
   }
   return 0;
}
int f(int n)
{
    if(n==1 || n==2)
    return 1; 
    else
    return f(n-1)+f(n-2);
} 
int main() 
{
    int n,num,ans,i;
    scanf("%d",&n);
    for(i=1;i<n;i++)
   { scanf("%d",&num);
    ans=f(num);
    printf("%d\n",ans);
   }
    scanf("%d",&num);
    ans=f(num);
    printf("%d",ans);
}
int  Fibonacci (int x);
int main(){
	int i,n,p[30];
    scanf("%d",&n);
    for(i=0;i<n;i++){
     scanf("%d",&p[i]);
	}
	for(i=0;i<n;i++){  
	printf("%d\n",Fibonacci (p[i]));
	}
	return 0;
}

int  Fibonacci (int x){
	int i,p,q,m,result;
	p=1;
	q=1;
	if(x==1){
		result=p;
	}
	else if(x==2){
	result=q;
	}
	else if(x>2){
		for(i=3;i<=x;i++){
		m=p+q;
		p=q;
		q=m;
		}
		result=q;
	}
	return result;
}
int main()
{
  int n,i;
  scanf("%d",&n);
  int a[n];
  for(i=0; i<=n-1;i++)
  {
    scanf("\n%d",&a[i]);
  }
  int A[20];
  A[0]=1;
  A[1]=1;
  for(i=2;i<=19;i++)
  {
    A[i]=A[i-1]+A[i-2];
  }
  for(i=0;i<=n-1;i++)
  {
    a[i]=A[a[i]-1];
  }
  printf("%d",a[0]);
  for(i=1;i<=n-1;i++)
  {
    printf("\n%d",a[i]);
  }
}
int main()
{
   int a,b,i,j,n,c;cin>>n;
    for(j=1;j<=n;j++)
          {
             a=1;b=1;cin>>c;
             for(i=1;i<=c/2;i++)
             {
                 a=a+b;b=a+b;}
        if(c%2==0) cout<<b-a<<endl;
        else   cout<<a<<endl;
          }
return 0;
}
int sum[21] = {0};
void calculate (int t);

int main()
{
	int n, i, a;
	cin >> n;
	sum[1] = sum[2] = 1;
	calculate (3);
	for (i = 1; i <= n; i++)
	{
		cin >> a;
		cout << sum[a] << endl;
	}

	return 0;
}

void calculate (int t)
{
	if (t <= 21)
	{	
		sum[t] = sum[t - 1] + sum[t - 2];
		calculate (t + 1);
	}
}
int main()
{
	int a[21],i,b[21],n;
	scanf("%d",&n);
	b[0]=1;
	b[1]=1;
	for(i=2;i<=20;i++)
		b[i]=b[i-1]+b[i-2];	
	for(i=1;i<n;i++)
	{
		scanf("%d",&a[i-1]);
	printf("%d\n",b[(a[i-1]-1)]);
	}
	scanf("%d",&a[n-1]);
	printf("%d",b[(a[n-1])-1]);

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