#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using vi = vector<int>;
ll n;
void input() { cin >> n; }
void solve() {
  ll ans = 0;
  for (int i = n; i > 1; i -= 2) ans += 4ll * (i - 1) * (i / 2);
  cout << ans << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.precision(16);
  cout << fixed;
  int _times = 1;
  cin >> _times;
  while (_times--) {
    input();
    solve();
  }
}
