101783: [AtCoder]ABC178 D - Redistribution

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

Score : $400$ points

Problem Statement

Given is an integer $S$. Find how many sequences there are whose terms are all integers greater than or equal to $3$, and whose sum is equal to $S$. The answer can be very large, so output it modulo $10^9 + 7$.

Constraints

  • $1 \leq S \leq 2000$
  • All values in input are integers.

Input

Input is given from Standard Input in the following format:

$S$

Output

Print the answer.


Sample Input 1

7

Sample Output 1

3

$3$ sequences satisfy the condition: $\{3,4\}$, $\{4,3\}$ and $\{7\}$.


Sample Input 2

2

Sample Output 2

0

There are no sequences that satisfy the condition.


Sample Input 3

1729

Sample Output 3

294867501

Input

题意翻译

给定整数 $ S $。请求出有几个序列,所有项都是 $ 3 $ 以上的整数,其总和是 $ S $。因为答案可能会非常大,所以请输出除以$ 1e9+7 $ 后的余数。 #### 输入格式 一个整数$ S $ #### 输出格式 答案除以$ 1e9+7 $后的余数

加入题单

算法标签: