Source Code
#include<bits/stdc++.h>
using namespace std;


int fib(int n)
{


	int f[n + 2];
	int i;

	f[0] = 0;
	f[1] = 1;

	for(i = 2; i <= n; i++)
	{
	f[i] = f[i - 1] + f[i - 2];
	}
	return f[n];
	}


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

	while(n--){
	    int b;
	    scanf("%d" , &b);
	cout <<fib(b+1)<<endl;}
	return 0;
}

// This code is contributed by SoumikMondal
Copy
Study Schedule mhna
GNU G++17
2065 ms
1.2 MB
Time Limit Exceeded