Mr. DeMello has decided to sabotage the marks of his student advisory!
To do this, he will assign each student the exams of another student in the advisory, ensuring no student gets their original exams.
Since you are not in Mr. DeMello's advisory (and want to ruin your friends' marks), he asks you to calculate the number of ways for him to assign the exams in his advisory .
Can you help him?
Subtask 1 [30%]
Subtask 2 [70%]
The first line will contain an integer, , the number of test cases.
The next lines will contain an integer, , the number of students in his advisory.
Output lines, the number of ways to assign each student the exams of another student in each advisory .
3 3 8 13
2 14833 290792918
Explanation for Sample Output
For the first test case, there are different assignments: