#include <bits/stdc++.h>
using namespace std;
void print(vector<long long> a) {
  for (long long i = 0; i < a.size(); i++) {
    cout << a[i] << " ";
  }
  cout << endl;
}
void solve() {
  long long n;
  cin >> n;
  long long sum = 0;
  long long p = 1;
  for (long long i = 1; i <= n / 2; i++) {
    sum = sum + i * 8 * p;
    p++;
  }
  cout << sum << endl;
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long t;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
