poj 1455 Crazy tea party

#include <iostream>
using namespace std;
int main()
{
int t,n,k;
cin
>>t;
while(t--)
{
cin
>>n;
k
=n/2;
cout
<<k*(k-1)/2+(n-k-1)*(n-k)/2<<endl;
}
}
//http://blog.sina.com.cn/s/blog_6f71bea30100oxyz.html

  

posted on 2011-07-22 20:01  sysu_mjc  阅读(88)  评论(0编辑  收藏  举报

导航