Source Code
int main() {
	long long int t;
	cin >> t;
	long long int n;
	for (int i = 1; i <= t; i++) {
		cin >> n;
		long long sum = n * (n + 1) / 2 + n * (n * (n - 1) / 2);
		cout <<sum << endl;
	}
	
	
	
	return 0;

}
Copy
Ali's Game hoodlum awm
GNU G++17
0 ms
0 KB
Compilation Error