CF1930E.2..3...4.... Wonderful! Wonderful!
普及/提高-
通过率:0%
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
Stack has an array a of length n such that ai=i for all i ( 1≤i≤n ). He will select a positive integer k ( 1≤k≤⌊2n−1⌋ ) and do the following operation on a any number (possibly 0 ) of times.
- Select a subsequence † s of length 2⋅k+1 from a . Now, he will delete the first k elements of s from a . To keep things perfectly balanced (as all things should be), he will also delete the last k elements of s from a .
Stack wonders how many arrays a can he end up with for each k ( 1≤k≤⌊2n−1⌋ ). As Stack is weak at counting problems, he needs your help.
Since the number of arrays might be too large, please print it modulo 998244353 .
† A sequence x is a subsequence of a sequence y if x can be obtained from y by deleting several (possibly, zero or all) elements. For example, [1,3] , [1,2,3] and [2,3] are subsequences of [1,2,3] . On the other hand, [3,1] and [2,1,3] are not subsequences of [1,2,3] .
输入格式
Each test contains multiple test cases. The first line contains a single integer t ( 1≤t≤2⋅103 ) — the number of test cases. The description of the test cases follows.
The first line of each test case contains a single integer n ( 3≤n≤106 ) — the length of the array a .
It is guaranteed that the sum of n over all test cases does not exceed 106 .
输出格式
For each test, on a new line, print ⌊2n−1⌋ space-separated integers — the i -th integer representing the number of arrays modulo 998244353 that Stack can get if he selects k=i .
输入输出样例
输入#1
4 3 4 5 10
输出#1
2 4 10 2 487 162 85 10
说明/提示
In the first test case, two a are possible for k=1 :
- [1,2,3] ;
- [2] .
In the second test case, four a are possible for k=1 :
- [1,2,3,4] ;
- [1,3] ;
- [2,3] ;
- [2,4] .
In the third test case, two a are possible for k=2 :
- [1,2,3,4,5] ;
- [3] .