You are given four integers a, d, K, and N. Consider N numbers, b1,b2,... ,bN where bi=a+(i−1)×d. Your task is to evaluate the following sum:
Since the sum can be very large, you are required to print it modulo 998244353.
Note: The sum is over all ordered tuples (v1,v2,... ,vN) satisfying N∑i=1vi=k.
Input format
Output format
For each test case (in a separate line), print K + 1 space-separated integers in a new line denoting the sum for each k = 0, 1, 2, .. ,K. Print the output modulo 998244353.
Constraints
1≤T≤10001≤a,d,N<9982443531≤K≤5×105Sum of K over all test cases does not exceed 106
In the first test case we have, a=1,d=3,K=3,N=3. Therefore, b1=1,b2=4,b3=7. We need to sum over tuples of the form (v1,v2,v3) satisfying N∑i=1vi=k.
In the second test case we have, a=2,d=1,K=2,N=4. Therefore, b1=2,b2=3,b3=4,b4=5. We need to sum over tuples of the form (v1,v2,v3,v4) satisfying N∑i=1vi=k.