language: Pascal (fpc) (fpc 2.2.0)
date: 97 days 18 hours ago
link:
visibility: public
1
2
3
4
5
6
7
8
9
10
11
12
13
var
F:array[1..100] of int64;
I,n,j:longint;
Begin
Read(n);
F[1]:=2;
F[2]:=4;
F[3]:=7;
For i:=4 to n do
For j:=1 to 3 do
If i-j>0 then inc(f[i],f[i-j]);
Writeln(f[n]);
End.