#QHD0000033. Cây k (k-Tree)
Cây k (k-Tree)
k-Tree
Source: Codeforces
Version: Phuoc Hung OJ Extended
Problem Statement
This package preserves the original task mechanism. Một cạnh trong cây có trọng số từ đến . Hãy đếm số dãy trọng số có tổng bằng và chứa ít nhất một trọng số không nhỏ hơn .
Input
Dòng duy nhất chứa .
Output
In số cách modulo .
Subtasks
- Subtask 1 — 20 points: small data.
- Subtask 2 — 30 points: medium data.
- Subtask 3 — 50 points: full PHOJ package limits.
Examples
Input
3 3 2
Output
3
Explanation
The output follows directly from the rules above.