#include<cstdio> #include<cmath> using namespace std; int main() { int t,n; scanf("%d",&t); while (t--) { scanf("%d",&n); int ans=n*(n-1)/2+n*(n-1)*(n-2)*(n-3)/24+1; printf("%d\n",ans); } return 0; }
Saturday, July 16, 2016
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment