#C1348. Tribonacci Sequence

    ID: 43022 Type: Default 1000ms 256MiB

Tribonacci Sequence

Tribonacci Sequence

This problem requires you to compute the n-th number in the Tribonacci sequence. The Tribonacci sequence is defined as follows:

\(T(0)=0, \; T(1)=1, \; T(2)=1\), and for \(n \geq 3\),

\(T(n)=T(n-1)+T(n-2)+T(n-3)\).

Your task is to write a program that reads an integer \(n\) from standard input and outputs the \(n\)-th Tribonacci number to standard output.

inputFormat

A single integer n, where n (\geq 0), representing the term of the Tribonacci sequence to compute.

outputFormat

A single integer representing the n-th term of the Tribonacci sequence.## sample

0
0