#K45617. Tribonacci Number
Tribonacci Number
Tribonacci Number
Given an integer n, compute the n-th Tribonacci number where the sequence is defined by the recurrence relation:
$$T(n)=T(n-1)+T(n-2)+T(n-3)$$
with initial conditions \(T(0)=0\), \(T(1)=1\), and \(T(2)=1\). This problem requires efficient computation of the recurrence for values up to \(n=37\).
inputFormat
The input consists of a single integer n (\(0 \le n \le 37\)), which represents the index of the Tribonacci number to compute.
outputFormat
Output the n-th Tribonacci number.
## sample0
0