#P10082. [GDKOI2024 提高组] 鸡
[GDKOI2024 提高组] 鸡
Problem Description
For a non-negative integer sequence , define its corresponding independent set sequence :
- Suppose we change to . Then we choose some numbers that are pairwise non-adjacent so that their sum is as large as possible. Let be this maximum sum.
Now given , determine how many non-negative integer sequences of length satisfy the following condition:
- There exists at least one non-negative integer sequence of length with values in such that .
Output the answer modulo the given prime .
Input Format
A single line with three numbers .
Output Format
A single line with one number, the answer.
3 1 1000000007
6
4 2 1000000007
47
20 24 1000000007
901565358
123 234 1000000009
141754844
1234 2345 1004535809
576196526
Hint
This problem uses bundled subtask tests.
For of the testdata, , , , and is prime.
- Subtask 1 (10%): .
- Subtask 2 (15%): , .
- Subtask 3 (25%): , .
- Subtask 4 (20%): .
- Subtask 5 (15%): .
- Subtask 6 (15%): No special constraints.
Translated by ChatGPT 5