1389 -- English Training of ALPCs
Time Limit :1000 MS Memory Limit :65536 KB
Accepts : 105 Submits : 185
User Accepts : 90 User Submits : 99
<Submit>   <Statistics>   <Discuss>

Description

As we all know, ACM is a competition of programming, the player in ACM is called ACMer. But in our school, we use ALPC instead of ACMer. Zzningxp is the coach of ALPCs, he used to be ALPC04, and I used to be ALPC62.
Zzningxp thinks much of ALPCs’ English. To improve ALPCs’ English effectively, Zzningxp decides to dispose an English composition for ALPCs every week and require ALPCs to check their compositions for each other.
When ALPCs complete their compositions, they should follow the checking requirements:

1. Each ALPC must choose only one composition.
2. None of ALPCs could check his own composition.
 
As usual, an outstanding ALPC can make an excellent composition, but one who can make an excellent composition not always becomes an outstanding ALPC. We heard that you want to join in ACM and become an outstanding ALPC. Before Zzningxp trains your English, he allows me to test your mathematic ability.
Now please calculate how many ways to distribute compositions under the above requirements, of course, you can program.
 

Input

The first line contains a number T, indicating the number of test cases. Each case contains only one integer N (1<=N<=12), the number of ALPCs.

Output

For each case output only one number.

Sample Input

3
1
2
3

Sample Output

0
1
2

 

Source

Alpc NUDT campus contest 2009
<Submit>   <Statistics>   <Discuss>
 


Powered by Zhang Zhaoning PDL College of Computer
Since 2006.03.09 | 2007.11.22 | 2010.03.02 Copyright (r) 2006 - 2010 All Rights Reserved