#include <bits/stdc++.h>
using namespace std;
long long int fast_expo(long long int x, long long int p) {
  if (p == 0)
    return 1;
  else if (p % 2 == 0) {
    long long int t = fast_expo(x, p / 2) % 1000000007;
    return (t * t) % 1000000007;
  } else
    return (x * (fast_expo(x, p - 1)) % 1000000007) % 1000000007;
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    long long int p = (n - 1) / 2;
    long long int p1 = n * n * (n / 2);
    long long int gg = (p * (2 * p + 1) * (2 * p - 1)) / 3;
    cout << p1 - gg << '\n';
  }
}
