| 比赛 | 
    东方版NOIP模拟赛 | 
    评测结果 | 
    WWWWWWWWWW | 
    | 题目名称 | 
    Marisa | 
    最终得分 | 
    0 | 
    | 用户昵称 | 
    Holiye | 
    运行时间 | 
    0.003 s  | 
    | 代码语言 | 
    C++ | 
    内存使用 | 
    0.31 MiB  | 
    | 提交时间 | 
    2015-10-28 21:56:42 | 
显示代码纯文本
#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<climits>
#include<algorithm>
using namespace std;
const int maxn=1000+2;
int t;
int n;
int s=1;
int j(int n);
int main()
{
	freopen("card.in","r",stdin);
	freopen("card.out","w",stdout);
	//freopen("test.in","r",stdin);
	//freopen("test.out","w",stdout);
	
	scanf("%d",&t);
	for(int i=1;i<=t;i++)
	{
		scanf("%d",&n);
		s=j(n)/2*j(n-2);
		if(s/3>0)
			cout<<s/3<<endl;
		else cout<<1<<endl;
	}
	
	return 0;
}
int j(int n)
{
	for(int i=1;i<=n;i++)
	{
		s*=i;
	}
}