Number of NKD Sequences
Time limit2sMemory limit512 MB
Count length-K strictly increasing sequences summing to N where consecutive differences are at most D and the first term is at most D, modulo 1e9+7.
- Level
Medium7 of 10
- Topics
- Dynamic programming, Combinatorics, Math, Sliding window
- Solved
- No attempts yet
Problem
You are given three integers , , and . Count the natural-number sequences of length that satisfy all of the following conditions.
- For every ,
Input
The first line contains three integers , , and , separated by spaces.
Output
Print the number of sequences satisfying the conditions, modulo .