#include #include #include #include #include #include #include long int sumOfGroup(int k) { int s=0; int c,r; if(k%2==0) { c=k*k; for(int i=1;i<=k/2;i++) { r=2; if(i==1) s=s+c+1; else{ s=s+c+r; r=r+2; } } for(int i=1;i<=k/2;i++) { r=2; if(i==1)s=s+c+1; else { s=s+c+r; r=r+2; } } } else { c=k*k; s=c; r=2; for(int i=1;i<=k/2;i++) { s=s+c-r; r=r+2; } r=2; for(int i=1;i<=k/2;i++) { s=s+c+r; r=r+2; } } return (s); // Return the sum of the elements of the k'th group. } int main() { int k; scanf("%i", &k); long int answer = sumOfGroup(k); printf("%ld\n", answer); return 0; }