#include <bits/stdc++.h>
using namespace std;
void online_judge() {}
void ISO() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
}
vector<long long> ans_value;
void ans() {
  long long int maxx = 1000001;
  ans_value.push_back(0);
  ans_value.push_back(8);
  long long value = 2;
  for (int i = 5; i < maxx; i += 2) {
    long long int x = ans_value.back();
    long long int y = (x + (4 * i - 4) * value);
    ans_value.push_back(y);
    value++;
  }
}
int main() {
  ISO();
  online_judge();
  long long int t;
  cin >> t;
  ans();
  while (t--) {
    int n;
    cin >> n;
    cout << ans_value[n / 2] << "\n";
  }
  return 0;
}
