#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    long long int n, m;
    cin >> n;
    n /= 2;
    long long int ans = (n * (n + 1) * (2 * n + 1)) / 3;
    ans *= 4;
    cout << ans << "\n";
  }
  return 0;
}
