#P6432. Problem G. Cyclic
Problem G. Cyclic
Problem Description
Count the number of cyclic permutations of length n with no continuous subsequence [i, i + 1 mod n].
Output the answer modulo 998244353.
Input
The first line of the input contains an integer T , denoting the number of test cases.
In each test case, there is a single integer n in one line, denoting the length of cyclic permutations.
1 ≤ T ≤ 20, 1 ≤ n ≤ 100000
Output
For each test case, output one line contains a single integer, denoting the answer modulo 998244353.
3
4
5
6
1
8
36