https://www.acmicpc.net/problem/1003
#include <iostream>
#include <vector>
using namespace std;
// 피보나치 함수
int call[] = {0, 0};
void solution(int n){
vector<pair<int, int>> dp(n+1, make_pair(0, 0));
dp[0].first = 1;
dp[1].second = 1;
for(int i=2;i<=n;i++){
dp[i].first = dp[i-1].first + dp[i-2].first;
dp[i].second = dp[i-1].second + dp[i-2].second;
}
cout<<dp[n].first<<" "<<dp[n].second<<endl;
}
#include<stdio.h>
int a[42]={1},n,t;
int main(){
scanf("%d",&t);
for(int i=2;i<42;i++)a[i]=a[i-1]+a[i-2];
for(int i=0;i<t;i++)scanf("%d",&n),printf("%d %d\n",a[n],a[n+1]);
}