#include <bits/stdc++.h>
using namespace std;
int main(void) {
  long long int t, n, l, r, s, q;
  cin >> t;
  while (t--) {
    l = 0;
    q = 0;
    r = 1;
    s = 1;
    cin >> n;
    while (r <= n) {
      q += (((r * r) - (s * s)) * l);
      s = r;
      r += 2;
      l++;
    }
    cout << q << endl;
  }
  return 0;
}
