For this Question: There is a sequence P, which is represented by the following recurrence
P(N) = P(N-2) + P(N-3)
P(0) = P(1) = P(2) = 1
Now given a number N your task is to find the Nth number in this sequence.
Note: Since the output could be very long, take mod 1000000007. And try to give the most optimum solution as you can.The input line contains T, denoting the number of testcases. Each testcase contains single line containing an integer N.

Constraints:
1 <= T <= 15 
1 <= N <=100For each testcase, print the nth number of the P sequence in a newline.Sample Input:
2
12
10

Sample Output:
21
12

Explanation:
Testcase 1:
As per the recurrence relation given in the question, we are basically adding last second and last third numbers of the sequence in bottom up manner. Let's see this case
P(3) = P(1) + P(0) = 2
P(4) = P(2) + P(1) = 2
P(5) = P(3) + P(2) = 3
P(6) = P(4) + P(3) = 4
P(7) = P(5) + P(4) = 5
P(8) = P(6) + P(5) = 7
P(9) = P(7) + P(6) = 9
P(10) = P(8) + P(7) = 12
P(11) = P(9) + P(8) = 16
P(12) = P(10) + P(9) = 21
, I have written this Solution Code: 
// author-Shivam gupta

#include <bits/stdc++.h>


using namespace std;

#define MEM(a, b) memset(a, (b), sizeof(a))

#define FOREACH(it, l) for (auto it = l.begin(); it != l.end(); it++)

#define IN(A, B, C) assert( B <= A && A <= C)

#define MP make_pair
#define FOR(i,a) for(int i=0;i<a;i++)

#define FOR1(i,j,a) for(int i=j;i<a;i++)

#define EB emplace_back

#define INF (int)1e9

#define EPS 1e-9

#define PI 3.1415926535897932384626433832795

#define MOD 1000000007
const int N = 3e5+5;

#define read(type) readInt<type>()
#define max1 100001
#define out(x) cout<<x<<'\n'
#define out1(x) cout<<x<<" "
#define END cout<<'\n'
const double pi=acos(-1.0);

typedef pair<int, int> PII;

typedef vector<int> VI;

typedef vector<string> VS;

typedef vector<PII> VII;

typedef vector<VI> VVI;

typedef map<int,int> MPII;

typedef set<int> SETI;

typedef multiset<int> MSETI;

typedef long int li;

typedef unsigned long int uli;

typedef long long int ll;

typedef unsigned long long int  ull;
const ll inf = 0x3f3f3f3f3f3f3f3f;
const ll mod = 998244353;
using vl = vector<ll>;

bool isPowerOfTwo (int x)
{
  /* First x in the below expression is
    for the case when x is 0 */
  return x && (!(x&(x-1)));
}
void fast(){
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
}
ll power(ll x, ll y, ll p)
{
    ll res = 1;      // Initialize result

    x = x % p;  // Update x if it is more than or
                // equal to p

    while (y > 0)
    {
        // If y is odd, multiply x with result
        if (y & 1)
            res = (res*x) % p;

        // y must be even now
        y = y>>1; // y = y/2
        x = (x*x) % p;
    }
    return res;
}


int Tot;

long long a[100010];
map <long long,int> mp;

void dfs(int now,int ee,int les)
{
    if (les==0||now+1==ee)
    {
        Tot++;
        return;
    }
    for (int i=0;i<=les;i++)
        dfs(now+1,ee,les-i);
}

void dfs2(int now,long long num,int les)
{
    if (now==0) num+=les*a[0];
    if (les==0||now==0)
    {
        mp[num]--;
        if (mp[num]==0) mp.erase(num);
        return;
    }
    for (int i=0;i<=les;i++)
        dfs2(now-1,num+i*a[now],les-i);
}
ll solve(ll x, ll y){
int a[50],b[50];
FOR(i,50){
a[i]=b[i]=0;}
int i=0;
while(x>0){
    a[i]=x%2;
    x/=2;
    i++;
}
i=0;
while(y>0){
    b[i]=y%2;
    y=y/2;
    i++;

}
int ans=0;
FOR(i,50){
if(a[i]!=b[i]){ans++;}
}
return ans;
}
int main()
{

ll a[101];
a[0]=a[1]=a[2]=1;
for(int i =3;i<=100;i++){
    a[i]=a[i-2]+a[i-3];
a[i]=a[i]%MOD;
}
int t;
cin>>t;
while(t--){
    int n;
    cin>>n;
    out(a[n]);
}
}
, In this Programming Language: C++, Now tell me if this Code is compilable or not?