Source Code
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int t;
	scanf("%d",&t);
	while(t--)
	{
	    int n;
	    scanf("%d",&n);
	    long long  sum=0;
	    sum=(n*n*n + n)/2;
	    
	    printf("%I64d",sum);
	    printf("\n");
	}
	return 0;
}
Copy
Ali's Game lanooshkh
GNU G++17
63 ms
7.1 MB
Wrong Answer