https://cn.vjudge.net/problem/Gym-101981G
思路:暴力处理顶点坐标;暴力数等边三角形;然后找规律;
总结:差分推公式;
最左边斜的几项0,1,2,3,3,1,0,0....是C(n,m)的系数;
#include <iostream>
#include <cstring>
#include <queue>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <set>
#include <map>
//#include<bits/stdc++.h>
using namespace std;
#define sfi(i) scanf("%d",&i)
#define sfs(i) scanf("%s",(i))
#define pri(i) printf("%d\n",i)
#define sff(i) scanf("%lf",&i)
#define ll long long
#define ull unsigned long long
#define mem(x,y) memset(x,y,sizeof(x))
#define INF 0x3f3f3f3f
#define eps 1e-10
#define PI acos(-1.0)
#define lowbit(x) ((x)&(-x))
#define zero(x) (((x)>0?(x):-(x))<eps)
#define fl() printf("flag\n")
#define MOD(x) ((x%mod)+mod)%mod
#define endl '\n'
#define pb push_back
#define FAST_IO ios::sync_with_stdio(false);cin.tie(0);cout.tie(0)
const int maxn=1e5+9;
const int maxm=4e5+9;
const int mod=1e9+7;
/*struct point
{
double x,y;
}p[maxn];
int cnt;
double dis(point a,point b)
{
double len=sqrt((a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y));
return len;
}
bool ch(point a,point b,point c)
{
double len1=dis(a,b);
double len2=dis(a,c);
double len3=dis(b,c);
return (fabs(len1-len2)<eps)&&(fabs(len1-len3)<eps)&&(fabs(len2-len3)<eps);
}*/
ll power(ll x,int n)
{
ll ans=1;
while(n)
{
if(n&1) ans=ans*x%mod;
x=x*x%mod;
n>>=1;
}
return ans;
}
int main()
{
FAST_IO;
//freopen("input.txt","r",stdin);
/*int n;
while(cin>>n)
{
cnt=0;
int num=0;
double y=0;
double h=sqrt(1.0-0.5*0.5);
double xx=0;
double x=0;
for(int i=n+1;i>=1;i--)
{
for(int j=1;j<=i;j++)
{
p[cnt].y=y;
p[cnt].x=x;
cnt++;
x+=1;
}
y+=h;
xx+=0.5;
x=xx;
}
for(int i=0;i<cnt;i++)
{
cout<<p[i].x<<" "<<p[i].y<<endl;
}
for(int i=0;i<cnt;i++)
{
for(int j=0;j<cnt;j++)
{
for(int k=0;k<cnt;k++)
{
if(i==j&&i==k) continue;
if(ch(p[i],p[j],p[k])) num++;
}
}
}
cout<<num/6<<endl;
}*/
int n;
int t;
ll inv=power(24,mod-2);
cin>>t;
while(t--)
{
cin>>n;
ll ans=n;
ans=ans*(n+1)%mod;
ans=ans*(n+2)%mod;
ans=ans*(n+3)%mod;
//cout<<ans<<endl;
cout<<(ans*inv)%mod<<endl;
}
return 0;
}