semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{
	int n,a[100],s[100],i,j;
	scanf("%d",&n);
	for(i=1;i<=n;i++)
	{
		scanf("%d\n",&a[i]);

		s[1]=1;
		s[2]=1;
		for(j=3;j<=a[i];j++)
		{
			s[j]=s[j-1]+s[j-2];
		}
		s[i]=s[a[i]];
		printf("%d\n",s[i]);
	}
	return 0;
}
int main()
{
	int n,a[100],t[100],i,j,c=1,b=1,e,l;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d",&a[i]);
	}
    for(i=0;i<n;i++)
	{
		if(a[i]==2||a[i]==1)
		{
			printf("1\n");
			
		}
		else
		{
			c=1;b=1;
		    for(j=2;j<a[i];j++)
		    {
			    t[j]=c+b;
				l=j;
			    e=b;
			    b=c+b;
			    c=e;
		    }
		    printf("%d\n",t[l]);
		}
	}
	return 0;
}
int f(int a);
int main()
{
	int a,n,k,i;
	int r[100];
	scanf("%d",&k);
	for(i=1;i<=k;i++){
	scanf("%d",&n);
	a=f(n);
	printf("%d\n",a);}
	return 0;
}
int f(int a){
	if(a==3){return 2;}
		else if(a==2||a==1){return 1;}
		else return (f(a-1)+f(a-2));
}
int change(int a, int b, int t, int k)
{
	if (t == k)
		return(a + b);
	else
		change(b, a + b, t, k + 1);
}
int main()
{
	int n, m;
	cin >> n;
	for (int i = 1;i <= n;i++)
	{
		cin >> m;
		if (m == 1 || m == 2)
			cout << 1 << endl;
		else
			cout << change(1, 1,m - 2, 1) << endl << endl;
	}
	return 0;
}
int main()
{
    int n,a,b[20];
    int i,j;
    scanf("%d",&n); 
    for(i=0;i<n;i++)
    {
          scanf("%d",&a);
          b[0]=1;b[1]=1;
          if(a==1||a==2) printf("1\n");
          else
          {for(j=2;j<a;j++)
          b[j]=b[j-2]+b[j-1];
          printf("%d\n",b[a-1]);}
    }
    getchar();
    getchar();
}
int num(int n)
{
    if(n==1) return 1;
    if(n==2) return 1;
    if(n>=3) return num(n-1)+num(n-2);
}

int main()
{
    int n,s,i;
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
        scanf("%d",&s);
        printf("%d\n",num(s));
    }
    getchar();
    getchar();
}
int a[20]={1,1};					//???????????2?????????????2???
								//??????????a[2]?a[3]?????????
								//??a[2]?????a???????4??????????????????????????????
								//???????????????????????????????????????wrong answer?
								//???????????????????????????????????????????????
								//???????????????a(1 <= a <= 20)???????int a[20]={1,1};
int n,i,k,j;
int main()
{
	cin>>n;
	for(i=1;i<=n;i++)//???
	{
		cin>>k;

		if(k>2)
		{

		for(j=2;j<=k-1;j++)
		{
			a[j]=a[j-1]+a[j-2];//????
		}

		}
	cout<<a[k-1]<<endl;
	}
return 0;
}
int f(int x)
{
    if(x==1||x==2)
      return 1;
    else
     return (f(x-1)+f(x-2));
}
int main()
{
    int n,i,k,m;
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
      scanf("%d",&k);
      m=f(k);
      printf("%d\n",m);
    }
    getchar();
    getchar();
}
int main()
{
	int a[20]={1,1};
	int i=0;
	for (i=2;i<=20;i++) a[i]=a[i-1]+a[i-2];//?20?
	int n=0;
	cin>>n;
	int b[100]={0};//????
	for (i=0;i<=n-1;i++)
	{
		cin>>b[i];
	}
	for (i=0;i<=n-1;i++)
	{
		cout<<a[b[i]-1]<<endl;
	}
	return 0;
}
int num(int a)
{
	int m;
	if (a==1||a==2)
		m=1;
	else
		m=num(a-1)+num(a-2);
	return (m);
}
int main()
{
	int i,n,m;
	int a[100];
	scanf("%d",&n);
	for (i=0;i<n;i++)
		scanf("%d",&a[i]);
	for (i=0;i<n;i++)
	{
		m=num(a[i]);
		printf("%d\n",m);
	}
	return 0;
}
int main()
{
int n,i,j,sum;
int sz[10000],b[30];
scanf("%d",&n);
 for(i=0;i<n;i++)
 scanf("%d",&sz[i]);
 for(i=0;i<n;i++)
  { 
    if(sz[i]==1||sz[i]==2){
      sum=1;
      }else {
      for(j=3;j<=sz[i];j++)
       {
      b[1]=1;
      b[2]=1;
      b[j]=b[j-2]+b[j-1];
      sum=b[j]; 
       }
     }
   printf("%d\n",sum);
   }
   return 0;
}
main()
{
      int n,i,a[20],j,f[21];
      scanf("%d\n",&n);
      for(i=0;i<n;i++)
      {scanf("%d",&a[i]);}
      f[1]=1;
      f[2]=1;
      for(j=3;j<=20;j++)
      {f[j]=f[j-1]+f[j-2];}
      for(i=0;i<n;i++)
      {
      printf("%d\n",f[a[i]]);}
      getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();
      }
/*
 * 38.cpp
 *??????
 *  Created on: 2012-11-2
 *      Author: ???
 */
int main() {              //?????
	int i, j, n, m;       //??int???
	int f[25];            //????f
	f[1] = 1;
	f[2] = 1;             //???f[1],f[2]??
	cin >> m;             //??????
	for (j = 1; j <= m; j++) {
		cin >> n;          //?????n
		if ((n == 1) || (n == 2)) {
			cout << f[n] << endl;
		}                   //??n??1?2???1
		else {
			for (i = 3; i <= n; i++) {
				f[i] = f[i - 1] + f[i - 2];
			}             //??n??2????????
			cout << f[n] << endl;   //????
		}

	}
	return 0;                //?????

}
int main()
{
	int n=0,a0=1,a1=1,a3=0,i=0,num[10],j=0;
	cin>>n;
	for(i=0;i<n;i++)
	{
		a1=1;
		a0=1;
		cin>>num[i];
		if(num[i]>2)
		{
			for(j=0;j<(num[i]-2);j++)
			{
					a3=a0+a1;
					a0=a1;
					a1=a3;
			}
			cout<<a1<<endl;
		}
		if(num[i]==1||num[i]==2)
			cout<<a1<<endl;
	}
	return 0;
}
int main(){
	int n,a[20],b[20],i,j,k,result[20];
	scanf("%d",&n);
	for(i=0;i<=n-1;i++){
		scanf("%d",&a[i]);
	}
	result[0]=1;
	result[1]=1;
	for(k=1;k<=n;k++){
		if(a[k-1]>=3){
			for(j=2;j<=a[k-1]-1;j++){
				result[j]=result[j-1]+result[j-2];
			}
			b[k-1]=result[a[k-1]-1];
			printf("%d\n",b[k-1]);
		}else if(a[k-1]==1||a[k-1]==2){
			printf("1\n");
		}
	}
	return 0;
}
int n;
int num[maxx];

int com(int x)
{
	if(x ==1 || x ==2)
	{
		return 1;
	}
	return com(x-1) + com(x-2);
}
int main()
{
	int temp;
	while(cin >> n)
	{
		while(n--)
		{
			cin >> temp;
			cout << com(temp) <<endl;
		}
	}
	return 0;
}
/* ??????????
 * ?????2012-10-21
 * ???winneshaw
 * ????????????????:
 *  ?????????????1????????????2?????
 *  ???????a???????????a??????
 */


int main(){
	int n;
	cin>>n;
	int a[20]={0};
	a[0]=1;
	a[1]=1;
	int i=2;
	int c=1,d=1;
	do {
		a[i]=c+d;
		c=d;
		d=a[i];
		i++;
	}while(i<20);
	int b[20]={-1};
	int istep=0;
	do{
		cin>>b[istep];
		istep++;
	}while(istep<n);
	int m=0;
		do{
			int e=b[m]-1;
			cout<<a[e]<<endl;
			m++;
		}while(m<n);
	return 0;
}
/*
 *???: 1.cpp
 *??????
 *????: 2012-10-19
 *??: ???????????n?n???????????????a??????
 */


int main ()
{
    int n = 0, iNum = 0;
    int a[20] = {1,1};
    for (int i = 2; i < 20; i++)
    {
        a[i] = a[i-1] + a[i-2];
    }                                           //??????????
    cin >> n;
    int b[n];
    for (int j = 1; j <= n; j++)
    {
        cin >> iNum;
        b[j-1]= a[iNum-1];
    }                                           //??????
    for (int k = 1;k <= n;k++)
    {
        cout << b[k-1] << endl;
    }                                           //??????
    return 0;
}
int main()
{
	int n,i,m,j;
	cin>>n;
	for(i=1;i<=n;i++)
		{
			cin>>m;
		int a=1,b=1;
		if(m>2)
		{
	for(j=3;j<=m;j++)
    {
    	a=a+b;
    	b=a-b;

    }
	cout<<a<<endl;
		}
		else
			cout<<"1"<<endl;
		}
	return 0;
}
int f(int a)
{
   if(a==1||a==2)  return 1;
   return f(a-1)+f(a-2);    
}
main()
{
  int n;
  scanf("%d",&n);
  printf("\n");
  int i;
  for(i=0;i<n;i++)
  {
     int a;
     scanf("%d",&a);
     printf("%d\n",f(a));
     printf("\n");                
  }   
}
int fibo(int n)
{
	if (n==1||n==2) return(1);
	return(fibo(n-1)+fibo(n-2));
}
void main()
{
	int n,i,a;
	scanf("%d",&n);
	for (i=0;i<n;i++)
	{
		scanf("%d",&a);
		printf("%d\n",fibo(a));
	}
}
int f(int str[], int i)
{
	if (i == 0)
		return str[0];
	else if (i == 1)
		return str[1];
	else
	{
		str[i] = f(str, i-1) + f(str, i-2);
		return str[i];
	}
}
int main()
{
	int str[22] = {1, 1};
	int a, n;
	cin >> n;
	for ( ; n > 0; n--)
	{
		cin >> a;
		cout << f(str, a - 1) << endl;
	}

	return 0;
}
int main(){
	int i=1,j=2,a,n,e,c[100],s[100],w[100];
	scanf("%d",&n);
	s[0]=1;
	for(int t=1;t<=90;t++){
		s[t]=i;
		e=j;
		j=i+j;
		i=e;
	}
	for(int r=0;r<=n-1;r++){
		scanf("%d",&c[r]);
		w[r]=s[c[r]-1];
	}
	for(int y=0;y<=n-1;y++){
		printf("%d\n",w[y]);
	}

	return 0;}
int a(int n)
{
    int i=1,j=1,k,x=1;
    if(n==1||n==2)
    return(1);
    else
    {
        for(k=0;k<n-2;k++)
        {
                     x=i+j;
                     i=j;
                     j=x;     
        }
        return(x);
    }
}
main()
{
      int n,i,j;
      scanf("%d",&n);
      for(i=0;i<n;i++)
      {
                      scanf("%d",&j);
                      printf("%d\n",a(j));
      }
      getchar();
      getchar();
}
int dijigeshu(int a);
int main(){
	int x=1,y=1;
	int n,a,b[100];
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		scanf("%d",&a);
		b[i]=dijigeshu(a);
	}
	for(int j=0;j<n;j++){
		printf("%d\n",b[j]);
	}
	return 0;
}
int dijigeshu(int a){
    int x=1,y=1,s;
	if(a==1||a==2){
		return 1;
	}else{
		for(int j=3;j<=a;j++){
			s=x+y;
			x=y;
			y=s;
		}
		return s;
	}
}
int f(int a)
{
  int num[21];
  if (a==1) num[1]=1;
  if (a==2) num[2]=1;
  if (a>2) num[a]=f(a-1)+f(a-2);      
  return (num[a]);   
}
main()
{
  int i,n,a,r; 
  scanf("%d",&n);
  for (i=1;i<=n;i++)
  {
    scanf("%d",&a);
    r=f(a);
    printf("%d\n",r);
  }   
}
int main() {
	int a,n,i=1,j=2,o=1,p=1,q=1;		//???a???q
	cin>>n;
	while (i<=n){
		cin>>a;
			while(j<a){
			q=o+p;
			o=p;
			p=q;
			j=j+1;						//????q
		}
		cout<<q<<endl;					//??q
		i=i+1;
		j=2;
		o=1;
		p=1;
		q=1;							//??
	}
	return 0;
}
int main()
{
	int n,i,j,m,a[100]={0};
	a[1]=a[2]=1;
	scanf("%d",&n);
	for(j=0;j<n;j++)
	{
		scanf("%d",&m);
		if(m==1||m==2)printf("1\n");
		else 
		{
			for(i=3;i<=m;i++)
			{
				a[i]=a[i-1]+a[i-2];
			}
		    printf("%d\n",a[m]);
		}
	}
}
int f(int x)
{
	int c;
	if(x==1||x==2)
		c=1;
	if(x>2)
		c=(f(x-1)+f(x-2));
	return c;
}
void main()
{
	int a[999],n,i;
	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 f(int);

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

int f(int ah)
{
	if (ah == 1 || ah == 2)
		return 1;
	return f(ah - 1) + f(ah - 2);
}
int main()
{
	int k,n,i,last1,last2,b,result;
	scanf("%d",&k);
    for(i=0;i<k;i++)
	{
		scanf("%d",&n);
		if(n==1||n==2)
		{
			printf("1\n");
		}
		else
		{
			last1=1;
			last2=1;

			for(b=3;b<=n;b++)
			{
				result=last1+last2;
				last2=last1;
				last1=result;
			}
		    printf("%d\n",result);
		}
	}
	return 0;
}
int main()
{
	int m,i=1,p,a=1,b=1,c[20]={0},sum;
	cin>>m;
	for (p=0;p<=m-1;p++)
		cin>>c[p];
	p=0;
	for (p=0;p<=m-1;p++)
	{   a=1;b=1;
		for (i=1;i<=c[p]-2;i++)
	  {
		  sum=a+b;a=b;b=sum;
	  }
	  cout<<b<<endl;
	}
	return 0;
}
int main()
{
  int *arr;
  int n,i,k;
  int a;
   
  scanf("%d",&n);
  for(i=1;i<=n;i++)
  {
    scanf("%d",&a);
	arr=(int*)malloc(sizeof(int)*a);
	for(k=0;k<a;k++)
	{
	  if(k==0||k==1)
         arr[k]=1;
	  else
		  arr[k]=arr[k-1]+arr[k-2];
	}
	 printf("\n%d\n",arr[a-1]);
  }
 
  return 0;
}
int main()
{
	int n, t;
	cin >> n;
	int i;
	while (n--)
	{
		int a = 1, b = 1, c;
		cin >> t;
		for (i = 0;i < t-1;i++)
		{
			c = a + b;
			a = b;
			b = c;
		}

		cout << a << endl;
	}
	return 0;
}
int main()
{
    int feb(int x);
    int n,i,j,a[1000],f;
    scanf("%d",&n); 
    for(i=0;i<n;i++)
    scanf("%d",&a[i]);
    for(j=0;j<n;j++)
    {
    f=feb(a[j]);
    printf("%d\n",f);
    }
    getchar();
    getchar();
}
int feb(int x)
{
    int i;
    int a[x+1];
    a[1]=1;
    a[2]=1;
    for(i=3;i<=x;i++)
    a[i]=a[i-1]+a[i-2];
    return(a[x]);
}
void compute(int shuzu);
int main()
{
	int n,i,k,sum=0,a,b;
	scanf("%d",&n);
	int *shuzu=(int*)malloc(sizeof(int)*n);
	for(i=0;i<n;i++)
	{
           scanf("%d",&shuzu[i]);
    }
    for(i=0;i<n;i++)
    {
        if(shuzu[i]<=2)
        {
           printf("1\n");
        }else{ 
               a=1;
               b=1;
               for(k=3;k<=shuzu[i];k++)
               {
                   sum=a+b;
                   a=b;
                   b=sum;
               }
               printf("%d\n",sum);
              }
    }
    free(shuzu);	
	return 0;
}
int f(int n, int a, int b)
{
	if (n <= 0)
		return a;
	return f(n - 1, b, a + b);
}
int main()
{
	int n, i, a;
	cin >> n;
	for (i = 1; i <= n; i++)
	{
		cin >> a;
		cout << f(a - 1, 1, 1) << endl;
	}
	return 0;
}
int p(int m)
{
 	int i,a[22];
 	a[1]=1;
    a[2]=1; 
    if(m>2)
	{ 
        for(i=3;i<=m;i++)
	    {
            a[i]=a[i-1]+a[i-2];
	    }	
	} 
	return a[m]; 
} 
int main()
{
 	int m,n,i;
    scanf("%d",&n);
	for(i=0;i<n;i++)
	{
	 	scanf("%d",&m);
		printf("%d\n",p(m));
	}	  
 	return 0;
}
main()
{
int j;
int a[20];
a[0]=1;a[1]=1;
for(j=2;j<20;j++)
a[j]=a[j-1]+a[j-2];
int n,i,t;
int b[20];
scanf("%d",&n);
for(i=0;i<n;i++)
{
 scanf("%d",&t);
 b[i]=a[t-1];
 }
for(i=0;i<n;i++)
printf("%d\n",b[i]);
getchar();
getchar();
}
int f(int n)
{
if(n==1||n==2)
return 1;
else
return f(n-1)+f(n-2);
}
int main()
{int n;
scanf("%d",&n);
while(scanf("%d",&n)!=EOF)
printf("%d\n",f(n));
}
int main(){
	int a=0,b=0,c=1,m,n;
	int x,y,z;
	int result=0;
	int sz[LEN];
	scanf("%d",&m);
	for(int i=0;i<m;i++)
	{
		scanf("%d",&(sz[i]));
        for(int j=1;j<=sz[i];j++)
		{
			b=a+c;
		c=a;
		a=b;
        result=b;
		}
		printf("%d\n",result);
		a=0;
		b=0;
		c=1;
	}
	return 0;
}
int main()
{
	int n,i,j;
	int a[20];
	int b[1000];
	int c[1000];
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d",&b[i]);
	}
	for(i=0;i<n;i++){
		c[i]=0;
	}
	for(i=0;i<n;i++){
		if(b[i]==1||b[i]==2){
			c[i]=1;
		}else if(b[i]>2){
	          for(j=3;j<=b[i];j++){
	        	a[1]=1;
				a[2]=1;
				a[j]=a[j-1]+a[j-2];
				c[i]=a[j];
			  }
		}
	}
	for(i=0;i<n;i++){
		printf("%d\n",c[i]);
	}
	return 0; 
}
int main()
{
    int a[20];
    a[1]=a[2]=1;
    int i;
    for(i=3;i<=20;i++)
    {
    a[i]=a[i-1]+a[i-2];
    }
    int n;
    cin>>n;
    int b[n];
    for(i=1;i<=n;i++)
    {
    cin>>b[i];
    }
    for(i=1;i<=n;i++)
    {
    cout<<a[b[i]]<<endl;
    }
}
int F(int n);
int 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]));
	}
	return 0;
}



int F(int n)
{
    if (n<=2)
        return 1;
    return F(n-1)+F(n-2);
}
int main(){
	int i,j;
	int r;
	scanf("%d",&r);
	int n;
	for(j=0;j<r;j++){
	scanf("%d",&n);
	int sz[10000];
	sz[0]=0;
	sz[1]=1;
	if(n==1){
		printf("1\n");
	}
   	if(n>=2){
		for(i=2;i<=n;i++){
			sz[i]=sz[i-1]+sz[i-2];
		}
			printf("%d\n",sz[n]);
			for(i=2;i<=n;i++){
				sz[i]=0;
			}
	}
	}
	return 0;
}
int main()
{
    int n;
    scanf("%d",&n);
    for(int z=0;z<n;z++)
    {
            int m;
            scanf("%d",&m);
            if(m==1||m==2)
            {printf("1\n");break;}
            int a=1,b=1,d,c;
            for(int i=2;i<m;i++)
            {
                    c=a+b;
                    d=b;
                    b=c;
                    a=d;
            }
            printf("%d\n",b);
    }
}
int F(int n);
int main(){int a[100];
 int n, result,i;
 scanf("%d", &n);
 for(i=0;i<n;i++){
	 scanf("%d",&a[i]);}
for(i=0;i<n-1;i++){
	printf("%d\n",F(a[i]));}
printf("%d",F(a[n-1]));
	

 return 0;
}



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

   }
int main(){
	int i,m,c[20],d[20],a,b,e,f;
	scanf("%d",&m);
	for(i=0;i<m;i++){
		scanf("%d",&c[i]);
	}
	for(i=0;i<m;i++){
		a=1;b=1;
		if(c[i]==1||c[i]==2){
		   d[i]=1;
		}
		else if(c[i]==3){
			d[i]=2;
		}
		else{
			for(int k=3;k<c[i];k++){
		        
				f=b;
				b=a+b;
				a=f;
				d[i]=a+b;
			}
		}
	}
	for(i=0;i<m;i++){
		printf("%d\n",d[i]);
	}
	return 0;
}
int main()
{
    int z[1001];
	int a,n;
	z[1]=1;
	z[2]=1;
    scanf("%d",&n);
	for(a=1;a<=998;a++)
	{
		z[a+2]=z[a+1]+z[a];
	}
	for(a=1;a<=n;a++)
	{
		scanf("%d",&z[0]);
		printf("%d\n",z[z[0]]);
	}
	return 0;
}
int feb(int n)
{
	if (n == 1)
		return 1;
	else
	{
		if (n == 2)
			return 1;
		else 
			return feb(n-1) + feb(n-2);
	}
	return true;
}

int main()
{
	int m, zu, i;
	int mem[10000];
	cin >> zu;
	for (i = 0; i < zu; i ++)
	{
		cin >> m;
		mem[i] = feb(m);
	}
	for (i = 0; i < zu; i ++)
	{
		if (i < zu - 1)
			cout << mem[i] << endl;
		else
			cout << mem[i];
	}
	return 0;
}
int a[21];
void cal()
{
     a[0]=1;
     a[1]=1;
     for(int i=2;i<=20;i++)
     a[i]=a[i-1]+a[i-2];
 }
int main()
{
    int t;
    scanf("%d",&t);
    cal();
    while(t--)
    {
        int n;
        scanf("%d",&n);
        printf("%d\n",a[n-1]);
    }
    
    return 0;
}
int feibo(int a)
{
	if(a==1)return 1;
	if(a==2)return 1;
	if(a!=1&&a!=2)return feibo(a-1)+feibo(a-2);
}
int main()
{
	int n,i,a,number[100]={0};
	number[1]=1;
	number[2]=1;
	cin >> n;
	for(i=1;i<=n;i++)
	{
		cin>> a;
		cout<<feibo(a)<<endl;
	}
	return 0;
}
/*
 * ????Fibonacci Sequence.cpp
 * ??????
 * ????: 2012-11-5
 * ??:??????????a??????
 */

int main(){
	int n,a[21],Fibonacci[21],i,k;
	cin >> n;
	for (k=1;k<=n;k++)          //????a????a[i]??
		cin >> a[k];
	Fibonacci[1]=1;
	Fibonacci[2]=1;
	for(i=3;i<=20;i++)
		Fibonacci[i]=Fibonacci[i-1]+Fibonacci[i-2];       //Fibonacci???????????
	for (k=1;k<=n;k++)
	cout << Fibonacci[a[k]] << endl;            //?????????
	return 0;
}
int main(){
	int n,i,m,j,r;
	int sz[1000];
	int s[1000];
	scanf("%d",&n);
	for(i=0;i<n;i++){		
		s[0]=1;
	    s[1]=1;
	scanf("%d",&m);
	if(m==1||m==2){
		sz[i]=1;
	}
	else{
	for(j=2;j<m;j++){
      r=s[j-1]+s[j-2];
	  s[j]=r;
           	}
	    sz[i]=r;
	}
	}
	for(i=0;i<n;i++){
	printf("%d\n",sz[i]);
	}
	return 0;
}
int f[25];

int cal(int t)
{
	if(t==1 || t==2)
	{
		f[t]=1;
		return 1;
	}
	if(f[t]<0)
	{
		f[t]=cal(t-1)+cal(t-2);
	}
	return f[t];
}

int main()
{
	int n;
	cin>>n;
	memset(f,-1,sizeof(f));
	while(n--)
	{
		int t;
		cin>>t;
		cout<<cal(t)<<endl;
	}
	return 0;
}
int main()
{
	int n,a[100],k,q,w,e,i;
	cin>>n;
	k=0;
	while (k<n)//????????
	{
		cin>>a[k];
		k++;
	}
	i=0;
	while (i<n)//???????????
	{
	q=w=1;
	e=0;
	k=2;
	if (a[i]==1)//?????1,2?,???1 ????????a[i]?
		cout<<q<<endl;
	else if (a[i]==2)
		cout<<w<<endl;
	else
	{
		while (k<a[i])
	{
		e=q+w;
		q=w;
		w=e;
		k++;
	}
	cout<<e<<endl;
	}
	i++;
	}

	return 0;
}
int main()
{
int sz[30];
int zs[25];
sz[0]=1;
sz[1]=1;
for(int i=2;i<30;i++){
sz[i]=sz[i-1]+sz[i-2];
}
int n,c,q;
scanf("%d",&n);
for(int j=0;j<n;j++){
scanf("%d",&(zs[j]));
}
for(int w=0;w<n;w++){
c=zs[w];
q=sz[c-1];
printf("%d\n",q);
}
}
/*
 * 1.cpp
 *
 *  Created on: 2012-10-8
 *      Author: Lixurong
 */



int add( int a );

int main()
{
	int n; //????
	cin >> n ; //????
	for( int i=0; i<n; i++ )
	{
		int a; //????
		cin >> a; //????
		if( a == 1 || a == 2 )
		{
			cout << 1 << endl; //??
			continue;
		}
		cout << add(a) << endl; //????
	}
	return 0; //??
}

int add( int a ) //??????????
 {
	 if( a == 1 )
		 return 1;
	 else if( a == 2 )
		 return 1;
	 else
		 return (add(a-1) + add(a-2));
 }
int w(int n);
int main(){
	int m,n,sz[100],i;
	scanf("%d",&m);
    for(i=1;i<=m;i++){
		scanf("%d",&n);
	    printf("%d\n",w(n));
	}
	return 0;
}
int w(int n){
	int i,sz[100];	
	sz[0]=0;
	sz[1]=1;
	if(n==0||n==1){
		return sz[n];
	}else{
        for(i=1;i<n+1;i++){
			sz[i+1]=sz[i]+sz[i-1];
		}
	}
	return sz[n];
}
int Fib(int n)
{
	int ans;
	if(n==0) ans = 0;
	else if(n==1) ans = 1;
	else ans = Fib(n-1)+Fib(n-2);
	return ans;
}
main()
{
	int n,num,i;
	scanf("%d",&num);
	for(i=0;i<num;i++)
	{
		scanf("%d",&n);
		printf("%d\n",Fib(n));
	}
}
int main(){
  int a,b,c,n,i,d,j;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&d);
    a=1;b=1;
    if(d<3){printf("1\n");break;}
    for(j=3;j<=d;j++){
      c=a+b;
      a=b;
      b=c;
    }
    printf("%d\n",c);
  }
  return 0;
}
int main()
{
	int i,j,k,m=0,h=0;
	int f[20]={1,1};
	int a[20]={0};
	int b[20]={0};
	int n;
	for(i=2;i<20;i++)
	{
		f[i]=f[i-2]+f[i-1];
	}
	for(i=0;i<20;i++)
	{
		a[i]=f[i];
	}
	scanf("%d",&n);
    for(j=0;j<n;j++)
	{
		scanf("%d",&b[j]);
	}
	for(k=0;k<n;k++)
	{
		m=b[k];
        h=a[m-1];
		printf("%d\n",h);
	}
	return 0;
}
int main(){
	int n,x,i=1,j,a,b,c;
	scanf("%d",&n);
	while(i<=n){
		scanf("%d",&x);
		j=1;
		a=1;
		b=1;
		while(j<=x-1){
			c=a+b;
			a=b;
			b=c;
			j++;
		}
		printf("%d\n",a);
		i=i+1;
	}
    return 0;
}
int fibbnacci(int x)
{
int a,b,c;
a=b=1;
if(x==1 || x==2) return a;
for(int i=3;i<=x;i++)
{c=b;b=a+b;a=c;
}
return b;
}
int main()
{
int a[15];
int n;cin>>n;
for(int i=0;i<n;i++)
{cin>>a[i];}

for(int j=0;j<n;j++)
{
cout<<fibbnacci(a[j])<<endl;}
return 0;
}
int main(int argc, char* argv[])
{
	int a[100];
	int m,n;
	a[0]=1;
	a[1]=1;
	scanf("%d",&m);
	for(int i=1;i<=m;i++)
	{
		scanf("%d",&n);
		for(int q=2;q<n;q++)
		{
				a[q]=a[q-1]+a[q-2];
			
		}
		printf("%d\n",a[n-1]);
	}
  	return 0;
}
void main()
{
	int Fibonacci(int n);
	int n, a[100], i;
	scanf("%d\n", &n);
	for(i=0; i<n; i++)
		scanf("%d", &a[i]);
	for(i=0; i<n; i++)
		printf("%d\n", Fibonacci(a[i]));
}
int Fibonacci(int n)
{
	int i, a[20];
	a[0]=1;
	a[1]=1;
	for(i=2; i<n; i++)
		a[i]=a[i-2]+a[i-1];
	return (a[n-1]);
}
int fib(int finput)
{
int i1,i2,temp,i;
i1=1;
i2=1;

if(finput==1||finput==2)
return 1;


for(i=2;i<finput;i++)
{
temp=i1+i2;
i1=i2;
i2=temp;

}
return i2;
}

int main()
{
int number;
int finput,i;
scanf("%d\n",&number);
for(i=0;i<number;i++)
{
scanf("%d\n",&finput);

if(i!=number-1)
{
printf("%d\n",fib(finput));
}
else
{
printf("%d",fib(finput));
}

}

return 0;
}
int fibonacci[1000] = {0, 1, 1};

int f(int n)
{
    if (fibonacci[n] > 0)
    {
        return fibonacci[n];
    }
    fibonacci[n] = f(n - 1) + f(n - 2);
    return fibonacci[n];
}
int main()
{
    int k, n;
    cin >> k;
    while (k--)
    {
        cin >> n;
        cout << f(n) << endl;
    }
    return 0;
}
int main()
{
	long n,i,j,a[20],c,d,e;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	scanf("%d",&a[i]);
	for(i=0;i<n;i++)
	{
		c=1,d=1,e=1;
		for(j=2;j<a[i];j++)
		{
			e=c+d;
			c=d,d=e;
		}
		printf("%d\n",e);
	}
	return 0;
}
/*????????????????: ?????????????1????????????2?????
 * ???????a???????????a??????
 * n?????????????
 *????: 2012-10-4
 *??: ??
 */

int main()
{
	int n, i, j, a;
    cin >> n;    //n???
    for(i = 1; i <= n; i++)
        {cin >> a;
        int fibo[a+1];      //????????
        fibo[0] = 0;        //fibo[0]???0??fibo[a]????
        fibo[1] = 1;
        for(j = 2; j <= a; j++)
	        fibo[j] = fibo[j-1] + fibo[j-2];    //???fibo[a]
        cout << fibo[a] << endl;
        }
    return 0;
}
void main()
{
int f(int j);
int n,i,j;
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d",&j);
printf("%d\n",f(j));

}

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


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

	scanf("%d",&n);
	for(i=0;i<n;i++)
		scanf("%d",&a[i]);
    b[1]=1;
	b[2]=1;
	for(j=3;j<=20;j++)
	{	b[j]=b[j-1]+b[j-2];}


	for(i=0;i<n;i++)
		printf("%d\n",b[a[i]]);
	return 0;
}
int F(int n);
int main()
{
	int n,x,i;
	int p[100];
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d",&x);
		p[i]=F(x);
        printf("%d\n",p[i]);
	}
	return 0;
}
int F(int n)
{
	int a[1000];
	a[0]=0;
	a[1]=1;
	int i;
	for(i=2;i<=n;i++)
		a[i]=a[i-1]+a[i-2];
	if(i==1)
		return 1;
	else
		return a[n];
}
int f(int n)
{
	if(n==1||n==2)
		return 1;
	else
		return f(n-1)+f(n-2);
}
void main()
{
	int n,i,shu[100];
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d",&shu[i]);
		printf("%d\n",f(shu[i]));
	}
}
/*
 * c++practice_026.cpp
 * name:??????
 *  Created on: 2011-11-1
 *      Author: zhujile
 */
int main(){
	int a[21]={1,1},n,i,num[100];
	cin>>n;
	for (int j=2;j<21;j++)
			a[j]=a[j-1]+a[j-2];     //??21????
	for (i=0;i<n;i++)
		cin>>num[i];                //??????????????
	for (i=0;i<n;i++)
		cout<<a[num[i]-1]<<endl;    //?????
	return 0;
}
int f(int n);
int main(int argc, char* argv[])
{
	int m,p,i;
	scanf("%d",&p);
	for(i=0;i<p;i++)
	{
		scanf("%d",&m);
		printf("%d\n",f(m));
	}
	return 0;
}

int f(int n)
{
	int result;
	if(n==1||n==2)
		result=1;
	else
		result=f(n-1)+f(n-2);
	return result;
}
int main()
{
    int a,n;
    int i,j;
    scanf("%d",&n);
    int b[20];
    b[0]=1;b[1]=1;
    for(i=0;i<n;i++)
    {
       scanf("%d",&a);
       if(a==1) printf("%d\n",b[0]);
       else if(a==2) printf("%d\n",b[1]);
       else if(a>2)
       {
            for(j=2;j<a;j++)
            b[j]=b[j-1]+b[j-2];
       printf("%d\n",b[a-1]);
       }
    }
    getchar();
    getchar();
}
int f(int i)
{
    int t;
    if (i==1||i==2)
    {
           t=1;
    }
    if(i>2)
    {
           t=f(i-2)+f(i-1);
    }
    return t;
}
main()
{
      int a[1000];
      int n;
      int i;
      int b;
      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]));
      }
      getchar();getchar();getchar();getchar();
}