#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    long long int m = (n - 1) / 2;
    long long int first = 0, second = 0;
    long long int no = 1;
    for (long long int i = 1; i <= m; i++) {
      first += no * i;
      no += 2;
      second += i;
    }
    long long int sum = 4 * first + 4 * second;
    cout << sum << endl;
  }
  return 0;
}
