include<iostream>
using namespace std;
long long cao(long long n,long long o)
{
long long sum1 = 1, sum2 = 1, sum3;
for (long long i = o, j = n; i > 0; i--,j--)
{
sum1 *= i;
sum2 *= j;
}
return sum2 / sum1;
}
int main()
{
long long n;
while (cin >> n && n != 0)
{
long long c[100] = { 0,0,1 };
for (long long i = 3; i <= 25; i++)
c[i] = (i - 1)*(c[i - 1] + c[i - 2]);
long long sum = 0;
{
for (long long i =2 ; i<(n / 2) + 1; i++)
{
sum += cao(n, i)*c[i];
}
cout << sum +1<< endl;
}
}
}
网友评论