https://www.acmicpc.net/problem/9095
t = int(input())
d = [0] * 12
d[1] = 1
d[2] = 2
d[3] = 4
for i in range(4, 12):
for j in range(1, 4):
d[i] += d[i - j]
for i in range(t):
n = int(input())
print(d[n])
1, 2, 3만 더할 수 있으므로 정수 n이 주어진다면 n-1에서 1을 더하면 n이 되고, n-2에서 2를 더하면 n이 되고, n-3에서 3을 더하면 n이 된다. 그러므로 n을 만들 수 있는 수는 n-1, n-2, n-3을 만들 수 있는 수를 다 더하면 된다.
점화식 생각해 내기 너무 어렵다....