#include <bits/stdc++.h>
using namespace std;
long long int a1[200005];
long long int a2[29];
vector<long long int> v, v1;
bool p[100000008];
void seive() {
  long long int i, j;
  for (i = 1; i * i <= 100; i++) {
    if (p[i] == false) {
      for (j = i * i; j <= 100; j += i) {
        p[j] = true;
      }
    }
  }
  v.push_back(2);
  for (i = 3; i <= 100; i += 2) {
    if (p[i] == false) {
      v.push_back(i);
      cout << i << endl;
    }
  }
}
int main() {
  long long int n, d = 0, k = 0, c = 0, x = 0, i = 0, m, f = 0, j = 0, j1,
                   sum = 0, s = 0, mx = 100000000000000000;
  cin >> n;
  while (n--) {
    cin >> m;
    k = 1;
    sum = 0;
    for (i = 3; i <= m; i += 2) {
      d = (i * 2) + (i - 2) * 2;
      sum += (d * k);
      k++;
    }
    cout << sum << endl;
  }
  return 0;
}
