Source Code
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int t;
	scanf("%d",&t);
	while(t--)
	{
	    long long n;
	    scanf("%I64d",&n);
	    long long  sum=0;
	    sum= (n*n*n )-((n+1)*(n-1)*n)/2;

	    printf("%I64d",sum);
	    printf("\n");
	}
	return 0;
}
Copy
Ali's Game lanooshkh
GNU G++17
78 ms
7.1 MB
Wrong Answer