P15298 [GeeksforGeeks] Count ways to express n as the sum of 13 and 44024
普及-
题目描述

Given N, count the number of ways to express N as sum of 1, 3 and 4 modulo (10^{9}+7).

Example 1:
Input:
N = 1
Output:
1
Explanation:
There is only one way to represent 1 as
sum of 1,3 and 4. 1 = {1}.
Example 2:
Input:
N = 3
Output:
2
Explanation:
There is 2 ways to represent 3 as sum
of 1,3 and 4. 3 = {1,1,1}, and 3 = {3}.

Your Task:
You don't need to read input or print anything. Your task is to complete the function countWays() which takes a Integer N as input and returns the number of ways possible.

Expected Time Complexity: O(N)
Expected Auxiliary Space: O(N)

Constraints:
1 <= N <= 10^{5}

输入格式

见题面

输出格式

见题面

样例输入
N = 1
样例输出
1