#P7835. Counting
Counting
Counting
Problem Description
Notice:Don't output extra spaces at the end of one line. Koishi loves counting problems. There are two permutations . Each permutation consists of integers from to . Koishi wants to merge them. She has an array . Initially is empty. In each operation, Koishi will compare two head elements of , select the smaller one, erase it from the permutation and append it to , if the two head elements are the same, Koishi can select one of them arbitrarily, and if one of permutation is already empty, Koishi will select the head element from the other one. Koishi will do this operation repeatedly until the two permutations are all empty. What's more, Koishi can also select and arbitrarily. Given ,How many different can be generated? modulo
Input
The first line contains an positive integer . There are test cases. The following lines, each contains an positive integer .
Output
You should output lines, each contain a non-negative integer integer representing the answer
Sample Input
4
1
2
3
4
Sample Output
1
4
38
650
Source
2020 Multi-University Training Contest 7