# k-Tree

Problem · 7 July 2026 · [Codeforces 431C](https://codeforces.com/problemset/problem/431/C)

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\le n,k\le 100$ and $1\le d\le k$.

**Output**

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

[Solution](https://xyzmaths.org/pow/k-tree/solution/index.md) · [Editorial](https://xyzmaths.org/pow/k-tree/editorial/index.md)
