6
6
In one jump, the frog can cover one, two or three steps.
In how many ways can the frog cross all the steps? Call it C(n).
For example, If n = 4, then all the possibilities for the frog are (1,1,1,1), (1,1,2), (1,2,1), (1,3), (2,1,1), (2,2), and (3,1).
Therefore, C(4) = 7.
For n above 30, you can see how slow your recursive functions are.
However, he is a very thin person and thus he cannot carry all the books to the city on one single day.
On the other hand, he wants to make the maximum profit by selling the books.
Your task is to the maximum profit that he can make not exceeding the safe weight limit.
The first line has an integer K which denotes the safe weight limit
The next line has an integer n which denotes the number of books
Output format:
Sample Input:
50
60
100
120
10
20
30
Sample Output:
220
Explanation: