#include using namespace std; unsigned long sumOfGroup(int k) { // Return the sum of the elements of the k'th group. unsigned long k1 = static_cast(k); return (k1*k1*k1); long s = 0; long t = 0; s = k*(k-1)+1; t = k*s + k*(k-1); return t; } int main() { int k; cin >> k; unsigned long answer = sumOfGroup(k); cout << answer << endl; return 0; }