#include <bits/stdc++.h>
using namespace std;
int main() {
  unsigned long long int n, i;
  cin >> n;
  while (n--) {
    unsigned long long int a;
    cin >> a;
    unsigned long long int j = 1, sum = 0, k = 8;
    for (i = 0; i < a / 2; i++) {
      sum += (8 * j * j);
      j++;
    }
    cout << sum << endl;
  }
  return 0;
}
