#include <bits/stdc++.h>
using namespace std;
unsigned long long n, a[500001];
int main() {
  long long t;
  cin >> t;
  while (t--) {
    cin >> n;
    long long x = n / 2;
    cout << 4 * (x * (x + 1) * (2 * x + 1)) / 3 << endl;
  }
}
