#include using namespace std; int main() { vectorsum(1000001); for(long long i = 1; i <= 1000000; i++) { sum[i] = sum[i-1]+i*i-i; } int T; cin >> T; while (T--) { int N; cin >> N; cout << sum[N-1]*2 << endl; } }