#includeusing namespace std;int main() { int a[103][103]; int n; cin >> n; int ct = 1, sum = 0; for(int i = 1; i <= n; i++) for(int j = 1; j <= n; j++) a[i][j] = ct++; for(int i = 1; i <= n /2 + 1 ; i++){ for(int j = n / 2 + 1 - i + 1; j <= n / 2 + 1 + i - 1; j++){ sum += a[i][j]; // cout << "ij:" << i << " " << j << " " << a[i][j] << endl; } } cout << "sum: " << sum << endl; for(int i = n / 2 + 2, k = 1; i <= n ; i++, k++){ for(int j = k + 1; j <= n - k; j++){ sum += a[i][j];// cout << "ij:" << i << " " << j << " " << a[i][j] << endl; } } cout << sum << endl; return 0;}/*1 2 3 4 56 7 8 9 1011 12 13 14 1516 17 18*/