6856.Throwing Dice

Time Limit: 1s Memory Limit: 512MB

Your task is to calculate the number of ways to get a sum $n$ by throwing dice. Each throw yields an integer between $1 \ldots 6$ .

For example, if $n=10$ , some possible ways are $3+3+4$ , $1+4+1+4$ and $1+1+6+1+1$ .

Input Format(From the terminal/stdin)

The only input line contains an integer $n$ .

  • $1 \le n \le 10^{18}$

Output Format(To the terminal/stdout)

Print the number of ways modulo $10^9+7$ .

Sample Input

Copy
8
 \n

Sample Output

Copy
125
   \n
Source: CSES, Mathematics, 1096

Submit

请先 登录

© 2025 FAQs