#include <bits/stdc++.h>
using namespace std;
long long int x[500001];
int main() {
  x[1] = 0;
  long long int i, d = 1;
  for (i = 3; i < 500001; i += 2) {
    long long int side = 4 * i - 4;
    x[i] = x[i - 2] + side * d;
    d++;
  }
  int t;
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    cout << x[n] << endl;
  }
  return 0;
}
