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