300684: CF130E. Tribonacci numbers
Memory Limit:64 MB
Time Limit:2 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
E. Tribonacci numberstime limit per test2 secondsmemory limit per test64 megabytesinputstandard inputoutputstandard output
Tribonacci numbers are a sequence of numbers, defined as follows:
- t0 = t1 = 0,
- t2 = 1,
- ti = ti - 1 + ti - 2 + ti - 3.
You are given n; calculate n-th tribonacci number modulo 26.
InputThe only line of input contains an integer n (1 ≤ n ≤ 1000).
OutputOutput n-th tribonacci number modulo 26.
ExamplesInput4Output
2Input
9Output
18