A Function Problem(Solved)

Revision en6, by chinaxjh, 2020-12-03 15:15:36

We define a function $$$f(x)$$$.And we know the function expression as following.

$$$f(x)=f(x-e)+f(x-2) (x>=3)$$$
$$$f(x)=1 (0<x<3)$$$

ps. $$$e$$$ means the natural base. We will give you an interger $$$x(0<x<=1*10^7)$$$.Please give us the $$$f(x)$$$ in 2 seconds.

For example

Input1

14

Output1

38

Input2

5

Output2

3

Thanks for my friend Kevin.He solved this problem and taught me how to solve it.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en6 English chinaxjh 2020-12-03 15:15:36 155
en5 English chinaxjh 2020-12-03 15:14:29 8
en4 English chinaxjh 2020-12-02 15:11:18 6
en3 English chinaxjh 2020-12-02 14:53:52 16 Tiny change: ' example\nInput1\n' -> ' example\n\nInput1\n'
en2 English chinaxjh 2020-12-02 14:52:42 129
en1 English chinaxjh 2020-12-02 14:45:21 337 (published)