#include <iostream>
#include <string.h>
#include <queue>
#include <algorithm>
using namespace std;
int main()
{
int n, m, i, j;
long long a[14] = { 0,0,1,2 };
for (int i = 1;i <= 14;i++)
a[i] = (i - 1)*(a[i - 1] + a[i - 2]);
while (cin >> n&&n)
{
long long c = 1, x = 1, y = 1;
m = n / 2;
for (j = 2;j <= m;j++)
{
for (i = n;i > (n - j);i--)
x *= i;
for (i = 1;i <= j;i++)
y *= i;
c += x / y * a[j];
x = 1;
y = 1;
}
cout << c << endl;
}
}
错排+组合………………理解清楚题目的意思以后就没问题了(水题)……所以我认为难点在于理解题目……反正我觉得这个题目有歧义……………理解不了的话…………对我而言就是难以解决的题