https://www.acmicpc.net/problem/9095
// 1, 2, 3 더하기
int solution(int t){
vector<int> n(3, 0);
n[0] = 1;
n[1] = 2;
n[2] = 4;
if(t <= 3)
return n[t-1];
for(int i=4;i<=t;i++){
int sum = n[0] + n[1] + n[2];
n[0] = n[1];
n[1] = n[2];
n[2] = sum;
}
return n[2];
}
#include <cstdio>
int t[11] = {0,1,2,4,7,13,24,44,81,149,274};
int main() {
int n,x;
scanf("%d", &n);
while (n--) {
scanf("%d", &x);
printf("%d\n",t[x]);
}
return 0;
}