View Code of Problem 60

#include <stdio.h>
using namespace std;

int main(){
	int t;
	int s;
	scanf("%d", &t );
	long long int arr[42] = {0,2,3};
	for( int i= 3; i<=40; i++ ){
		arr[i] = arr[i-1] + arr[i-2];
	}
	int k=1;
	while( t-- ){
		scanf("%d", &s );
		printf("Scenario #%d:\n%lld\n",k++, arr[s] );
	}

	return 0;
	
}

Double click to view unformatted code.


Back to problem 60