k-Tree
· Codeforces 431C
Dynamic Programming / Trees · Difficulty 6/10 · 45 min
In an infinite rooted tree, every vertex has one child for each integer weight from 1 to k. Moving to that child adds its edge weight to the path. Starting at the root and moving only to children, how many paths have total weight n and use at least one edge of weight d or greater?
Input
A single line contains n, k, and d, in that order. The bounds are 1≤n,k≤100 and 1≤d≤k.
Output
Print the number of qualifying paths modulo 109+7.