#P11616. [PumpkinOI Round 1] 瓦解
[PumpkinOI Round 1] 瓦解
Background
Time takes the camera away, without thinking. Memories will not let go.
Problem Description
You have an array of length . Xiao Q wants you to split it into at most non-empty consecutive segments, and the numbers in each segment must be strictly increasing. Now Xiao Q wants to know how many splitting plans there are in total. Since the number of plans may be very large, you only need to output the result modulo .
Input Format
This problem contains multiple test cases.
The first line contains an integer , which indicates the number of test cases.
Then follow test cases. Each test case is given in the following format:
The first line contains two integers , representing the array length and the segment limit.
The second line contains integers .
Output Format
For each test case, output one line containing one integer, which is the number of plans modulo .
2
3 2
2 3 1
10 5
7 10 9 23 1 6 7 8 9 20
1
29
Hint
Sample Explanation
- For the first test case, there is only one plan: .
Constraints
This problem uses bundled testdata.
- Subtask 0 (0 pts): samples.
- Subtask 1 (10 pts): .
- Subtask 2 (20 pts): .
- Subtask 3 (10 pts): the array itself is guaranteed to be strictly increasing.
- Subtask 4 (30 pts): .
- Subtask 5 (30 pts): .
For all testdata, it is guaranteed that .
Translated by ChatGPT 5