#include using namespace std; int main() { int t; cin >> t; vector out(1000001); out[3] = 4; for(int i=4;i<1000001;i++) { long long p = (long long)(i - 1) * (i - 2); // q = (1 + 2 + 3 + ... + i - 2) * 2 long long q = (long long)(i - 1) * (i - 2); out[i] = out[i-1] + p + q; } for(int i=0;i> n; cout << out[n] << endl; } return 0; }