Given three integers , , and , consider arrays of length and sets of intervals of size that satisfy the following conditions:
0 \leq a_i \leq m for 1 \leq i \leq n;
S = \{[l_1, r_1], \dots, [l_k, r_k]\}, where:
l_1 = 1, r_k = n;
r_i + 1 = l_{i+1} for 1 \leq i < k.
For k = 1, 2, \dots, R, count the number of different pairs that satisfy the condition:
The of the array is defined as the smallest non-negative integer that does not appear in . For example, if a = [0, 1, 2, 4], then \text{mex}(a) = 3, since is the smallest non-negative integer that is not present in .
Since the answer may be large, you need to output it modulo .
The first line contains the number of test cases (1 \le t \le 200).
The only line of each test case contains three integers , , and (2 \le n \le 400, 1 \le m \le 10^6, 1 \le R \le n).
It is guaranteed that the sum of across all test cases does not exceed .
For each test case, output integers separated by spaces on a new line — the number of pairs that satisfy the above condition for k = 1, 2, \dots, R.
Example 1
In the first test case:
For k=1, can only be , and the array can be [0, 0], [0, 1], [1, 0], and . Thus, there are different pairs :
(,).
(,).
(,).
(,).
For k=2, can only be \{[1,1],[2,2]\}, and the array can be and . Thus, there are different pairs :
(,\{[1,1],[2,2]\}).
(,\{[1,1],[2,2]\}).
( points): t=1, n+m \le 10, R=1;
( points): t=1, n+m \le 10, R=n;
( points): m = 1;
( points): m = 2;
( points): m \le 5;
( points): R = 1;
( points): \sum n \le 100;
( points): no additional constraints;