#include <bits/stdc++.h>
using namespace std;
const double pi = 3.141592653589793238462643383279;
const int MOD = 1e9 + 7;
const int INF = 1e9;
const double eps = 0.000000000000001;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int t;
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    long long int moves = 0;
    long long int prev = 0;
    long long int x = 3;
    long long int i = 1;
    while (x <= n) {
      moves = prev + (((x * 4) - 4) * i);
      prev = moves;
      i++;
      x = x + 2;
    }
    cout << moves << "\n";
  }
  return 0;
}
