#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
void solve() {
  long long n, res = 0, p = 8;
  cin >> n;
  for (int i = 0; i < (n / 2); ++i) {
    res += (long long)(i + 1) * p;
    p += 8;
  }
  cout << res << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  cin >> t;
  while (t--) solve();
  return 0;
}
