#QHD0000004. Tổ hợp xúc xắc (Dice Combinations)
Tổ hợp xúc xắc (Dice Combinations)
Dice Combinations
Source: CSES
Version: Phuoc Hung OJ Extended
Problem Statement
Count the sequences of dice throws whose values sum to . Each throw is between 1 and 6, and order matters.
Input
The only line contains integer .
Output
Print the number of ways modulo .
Subtasks
- Subtask 1 — 20 points: 1 <= n <= 15.
- Subtask 2 — 30 points: 1 <= n <= 10000.
- Subtask 3 — 50 points: 1 <= n <= 1000000.
Examples
Input
3
Output
4
Explanation
For , the four sequences are , , , and .