Let p=(p1,p2,…,pn) be a permutation of {1,2,…,n}.
For every index 1≤i≤n, define
pg(i)={max{j∣1≤j<i, pj>pi}−1if such a j exists,otherwise.The funniness of a permutation p is
f(p)=i=1∑npg(i).Given n, compute
p∈Sn∑f(p)(mod998244353),
where Sn is the set of all n! permutations of {1,2,…,n}.
The first line contains a single integer t (1≤t≤106), the number of test cases.
Each of the next t lines contains a single integer n (1≤n≤106).
Output
For each test case, print a single line containing ∑p∈Snf(p) modulo 998244353.
Exemplul 1
stdin
3
3
10
2048
stdout
998244352
108328320
887633861
Note
In the first test case, n=3. The six permutations of {1,2,3} are:
| p |
pg(1) |
pg(2) |
pg(3) |
f(p) |
| (1,2,3) |
−1 |
−1 |
−1 |
−3 |
| (1,3,2) |
−1 |
−1 |
2 |
0 |
| (2,1,3) |
−1 |
1 |
−1 |
−1 |
| (2,3,1) |
−1 |
−1 |
2 |
0 |
| (3,1,2) |
−1 |
1 |
1 |
1 |
| (3,2,1) |
−1 |
1 |
2 |
2 |
For example, in p=(3,1,2), the nearest element to the left of position 3 that is greater than p3=2 is p1=3, so pg(3)=1.
The total is −3+0−1+0+1+2=−1, and −1≡998244352(mod998244353).