#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main()
{
//freopen("input.txt", "rt", stdin);
long long DynamicLengths[101] = { 0, 1, 1, 1, 2, 2, 3, 4, 5, 7, };
for (int i{ 10 }; i <= 100; ++i)
{
DynamicLengths[i] = DynamicLengths[i - 1] + DynamicLengths[i - 5];
}
int CntCase{};
cin >> CntCase;
for (int i{}; i < CntCase; ++i)
{
int N{};
cin >> N;
cout << DynamicLengths[N] << '\n';
}
return 0;
}