Fancy Stack
시간 제한3초메모리 제한512 MB
블록 크기의 순열 중에서 값이 오르내리기를 번갈아 하고 짝수 번째 위치의 값이 엄격히 증가하는 순열의 개수를 998244353으로 나눈 나머지로 구한다.
문제
Little Fiona has a collection of blocks of various sizes , where is even. Some of the blocks can be equal in size. She would like to put all these blocks one onto another to form a fancy stack.
Let be the sizes of blocks in the stack from top to bottom. Since Fiona is using all her blocks, must be a permutation of . Fiona thinks the stack is fancy if both of the following conditions are satisfied:
- The second block is strictly bigger than the first one, and then each block is alternately strictly smaller or strictly bigger than the previous one. Formally, .
- The sizes of the blocks on even positions are strictly increasing. Formally, (remember that is even).

Two stacks are considered different if their corresponding sequences differ in at least one position.
Fiona wants to know how many different fancy stacks she can build with all of her blocks. Since large numbers scare Fiona, find this number modulo .
입력
Each input contains multiple test cases. The first line contains the number of test cases (). Description of the test cases follows.
The first line of each test case contains a single integer --- the number of blocks at Fiona's disposal (; is even). The second line contains integers --- the sizes of the blocks in non-decreasing order ().
It is guaranteed that the sum of over all test cases does not exceed .
출력
For each test case, print the number of ways to build a fancy stack, modulo .