logo AlgoBeat OnlineJudge
登录 注册

#214819. [ICPC 2023 Tehran R] Jackson House

内存限制:1024 MiB 时间限制:2000 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

Jackson, after witnessing the advancements in the world of technology, decided to sell his small cozy house and enroll in the programming-and-algorithm micromaster. He came across an interesting algorithm that he needed to analyze and solve the problem related to it, in order to pass the exam at this stage of the course. The pseudocode of this algorithm is as follows:

He wants to know for how many permutations of length from the possible ones, the final permutation will be sorted after running this algorithm.

输入格式

The first line contains an integer (), the number of test cases.

Each of the next lines contains an integer (), representing the length of the permutation for the test case.

输出格式

Output lines. On the line, print the number of permutations of length which will be sorted after running the provided algorithm on it. Since the output could be very large, output the result modulo .

样例

样例输入 1

4
3
5
10
20

样例输出 1

4
16
1728
23887872