Source Code
#include <iostream>
using namespace std;


long long X, Y, Z, sum = 0;


void solve() {
	cin >> Y;
	sum = 0;
	sum = Y * ((1 + (Y * Y)) / 2);
	cout << sum << endl;
}

int main() {
    ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
	cin >> X;
	for (int i = 0; i < X; i++) solve();
}

Copy
Ali's Game YousefShaheen
GNU G++17
1 ms
184 KB
Wrong Answer