#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
int on_bit(int N, int pos) { return N = N | (1 << pos); }
int off_bit(int N, int pos) { return N = N & ~(1 << pos); }
bool check_bit(long long int N, int pos) { return (bool)(N & (1 << pos)); }
template <class T>
inline bool read(T &x) {
  int c = getchar();
  int sgn = 1;
  while (~c && c < '0' || c > '9') {
    if (c == '-') sgn = -1;
    c = getchar();
  }
  for (x = 0; ~c && '0' <= c && c <= '9'; c = getchar()) x = x * 10 + c - '0';
  x *= sgn;
  return ~c;
}
int main() {
  unsigned long long ar[500005];
  memset((ar), 0, sizeof((ar)));
  for (unsigned long long i = 3, j = 1; i <= 500001; i += 2, j++) {
    ar[i] = ((i * 4) - 4) * j;
  }
  for (int i = 5; i <= 500001; i += 2) {
    ar[i] += ar[i - 2];
  }
  int ___T;
  cin >> ___T;
  for (int cs = 1; cs <= ___T; cs++) {
    int n;
    cin >> n;
    cout << ar[n] << "\n";
  }
  return 0;
}
