#P7816. Set2

Set2

Set2

Problem Description

You are given a set S={1..n}S=\{1..n\}. You have to do the following operations until there are no more than kk elements left in the SS: Firstly, delete the smallest element of SS, and then randomly delete another kk elements one by one from the elements left in SS in equal probability. Note that the order of another deleted kk elements matters. That is to say, you delete pp after qq or delete qq after pp, which are different ways. For each i[1,n]i \in [1,n], determine the probability of ii being left in the SS. It can be shown that the answers can be represented by PQ\frac{P}{Q}, where PP and QQ are coprime integers, and print the value of P×Q1 modP \times Q^{-1} \ mod  998244353\space 998244353.

Input

The first line contains the only integer T(T[1,40])T(T \in [1,40]) denoting the number of test cases. For each test case: The first line contains two integers nn and kk. It guarantees that: $n \in [1,5000] ,\ \sum n \in [1,3 \times 10^4],\ k \in [1,5000].$

Output

For each test case, you should output nn integers, the ii-th of them means the probability of ii being left in the SS.

Sample Input

1
5 2

Sample Output

0 499122177 499122177 499122177 499122177

Source

2020 Multi-University Training Contest 5