For this Question: A Tribonacci number T(n) is the sum of the preceding three elements in a series.

Calculate the value of the nth Tribonacci number modulo 1000000007. The initial three numbers of this series will be a, b and c i.e., T(1)=a, T(2)=b, T(3)=c.The only line of input contains 4 integers n, a, b, c.

Constraints
4 ≤  n ≤ 10^5
1 ≤  a, b, c ≤ 1000000000Print the result containing one integer i.e., T(n) modulo 1000000007.Input1:
5 1 2 3

Output1:
11

Input2:
4 1 1 1

Output2:
3

Explanation(might now be the optimal solution):
Input 1: 
Follow the below steps:-
T(1) = 1
T(2) = 2
T(3) = 3
T(4) = 6
T(5) = 11, I have written this Solution Code: #include "bits/stdc++.h"
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 = 2e3+ 5;
const int mod = 1e9 + 7;
const int inf = 1e18 + 9;

void solve(){
	int n, a, b, c;
	cin >> n >> a >> b >> c;
	for(int i = 4; i <= n; i++){
		int x = (a + b + c) % mod;
		a = b;
		b = c;
		c = x;
	}
	cout << c << endl;
}

void testcases(){
	int tt = 1; 
	//cin >> tt;
	while(tt--){
		solve();
	}
}

signed main() {
	IOS;
		clock_t start = clock();
	
	testcases();

	cerr << (double)(clock() - start)*1000/CLOCKS_PER_SEC << " ms" << endl;
	return 0;
}, In this Programming Language: C++, Now tell me if this Code is compilable or not?