1*2+2*3+3*4+……+n*(n+1)=n*(n+1)*(n+2)/3
注意数据大了,所以先n*(n+1)取% (20090524*3)保证后面的数可以被3除
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
#include<stdio.h>
int t;
int main()
{
scanf("%d",&t);
while(t--)
{
__int64 n;
scanf("%I64d",&n);
__int64 all=0;
if(n==1)
{
printf("1\n");
continue;
}
all=(__int64)(n*(n+1)/2)%(20090524*3);
all=(__int64)(all*(n+2)/3)%20090524;
printf("%I64d\n",all);
}
}