#include <bits/stdc++.h>
using namespace std;
int main() {
  int test;
  cin >> test;
  while (test--) {
    int size;
    cin >> size;
    long long ans = 0, cells = 8, lvl = 1;
    size /= 2;
    while (size--) {
      ans += (cells * lvl);
      cells += 8;
      lvl++;
    }
    cout << ans << '\n';
  }
}
