For this Question: A child is running up a staircase with n steps and can hop either 1 step, 2 steps or 3 steps at a time. Implement a method to count how many possible ways the child can run-up to the stairs. You need to return all possible number of ways.
The time complexity of your code should be O(n).
Print answer modulo 10^9 + 7.The input line contains T, denoting the number of testcases.  Each testcase contains single line containing N, i.e. stairs having number of steps.  

Constraints
1 <= T <= 10
1 <= N <= 10^5Find the total number of ways. Since the answer can be very large, thus print them as modulo 10^9 + 7.Sample Input
2
4
3

Sample output
7
4

Explanation:
Testcase 1:
In this case we have stairs with 4 steps. So we can figure out how many ways are there to reach at the top.
1st: (1, 1, 1, 1)
2nd: (1, 1, 2)
3rd: (1, 2, 1)
4th: (1, 3)
5th: (2, 1, 1)
6th:  (2, 2)
7th: (3, 1), I have written this Solution Code: #include "bits/stdc++.h"
#pragma GCC optimize "03"
using namespace std;
 
#define int long long int
#define ld long double
#define pi pair<int, int>
#define pb push_back
#define fi first
#define se second
#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#ifndef LOCAL
#define endl '\n'
#endif
 
const int N = 2e5 + 5;
const int mod = 1e9 + 7;
const int inf = 1e9 + 9;

int a[N];

signed main() {
	IOS;
	int t;	cin >> t;
	a[0] = 1;
	for(int i = 1; i < N; i++){
		if(i >= 1)	a[i] += a[i-1];
		if(i >= 2)	a[i] += a[i-2];
		if(i >= 3)	a[i] += a[i-3];
		a[i] %= mod;
	}
	while(t--){
		int n;	cin >> n;
		cout << a[n] << endl;
	}
	return 0;
}, In this Programming Language: C++, Now tell me if this Code is compilable or not?