1390D.cpp 319 B

1234567891011121314151617181920
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int main() {
  4. ///Input Process Output
  5. int N;
  6. cin >> N;
  7. while (N--) {
  8. int n = 5;
  9. cin >> n;
  10. int s = 0;
  11. for (int i = 1; i <= n; i++) {
  12. s += i * (i + 1) / 2;
  13. }
  14. cout << s << endl;
  15. }
  16. return 0;
  17. }