Mr. DeMello has decided to sabotage the marks of his
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?
Constraints
Subtask 1 [30%]
Subtask 2 [70%]
Input Specification
The first line will contain an integer,
The next
Output Specification
Output
Sample Input
Copy
3
3
8
13
Sample Output
Copy
2
14833
290792918
Explanation for Sample Output
For the first test case, there are
Comments