#P17436. 「LWLV Round 1」Jump!
「LWLV Round 1」Jump!
Background
Little L really loves to jump, but this also makes him get faked out and knocked away in basketball games.
Problem Description
Little L has a sequence of length , where all elements are within .
Little L has a variable , initially .
Then Little L will perform the jump operation on the variable several times until no more operations can be performed. Specifically, if , then increases by .
Due to the nature of the jump operation, in the end we will have . He wants to know how many sequences make after performing the jump operation several times.
Since the answer may be very large, output the result modulo .
Input Format
This problem has multiple test cases.
The first line contains a positive integer , denoting the number of test cases.
Then there are test cases. For each test case, one line contains a positive integer .
Output Format
For each test case, output the answer modulo .
3
2
20
1145141919810
3
292439931
825800492
Hint
Sample Explanation
When , there are the following sequences that satisfy the requirement:
Constraints
| Subtask ID | Score | ||
|---|---|---|---|
For of the testdata, it is guaranteed that and .
Translated by ChatGPT 5