"Title description"
One day, Qi Cirno wrote n letters to be loaded into N envelopes, but all loaded wrong ... Now you want to know how many kinds of possibilities are wrong.
"Input description"
Number of letters and envelopes N.
"Output description"
The number of possibilities to mount the error.
"Sample Input"
Input Example 1
2
Input Example 2
4
"Sample Output"
Output Example 1
1
Output Example 2
9
"Data range and Tips"
1≤n≤100
source code: #include<cstdio>intn,f[101];intMain () {scanf ("%d",&N); f[1]=0; f[2]=1; for(intA=3; a<=n;a++) F[a]= (A-1) * (f[a-1]+f[a-2]);//the wrong-row formula is applied. printf"%d", F[n]);//the subject should also use high-precision algorithms, but this is ignored. return 0;}/*Number theory-"wrong formula": f[n]= (n-1) * (F[n-1]+f[n-2]) Step 1: Place nth element in any position, e.g. position K (except position N). Step 2: Placing the K element is nothing more than the following two possible: (1) placed in position N: Then the remaining (n-2) elements have an F (n-2) method of placement. (2) Do not place in position N: the remaining (n-2) elements have an F (n-1) Placement method. */
⑨ to write.