#P9853. Count
Count
Count
Problem Description
You are given three positive integers , , and . Your task is to calculate the total number of sequences of length that satisfy the following conditions:
- All elements of are integers from to (inclusive).
- Let be the -th element of sequence . For all positive integers not exceeding , it is satisfied that . Calculate the total number of such sequences that satisfy the conditions and output the result modulo 998244353.
Input
The first line contains an integer , representing the number of test cases. Each of the next lines contains three integers , , and , representing the parameters for one test case.
Output
For each test case, output an integer representing the answer.
Sample Input
1
11 2 1
Sample Output
1024
Source
2023“钉耙编程”中国大学生算法设计超级联赛(6)