func_code_string: #include <bits/stdc++.h>   using namespace std;   int n, m, r, ans, b[505], c[505], a[505][505], s[505][505], sm[505][505],       mxl[505][505], sl[505][505], mxr[505][505], sr[505][505];   long long t;   inline int read() {     int x = 0, f = 1;     char ch = getchar();     for (; !isdigit(ch); ch = getchar())       if (ch ==  - ) f = -1;     for (; isdigit(ch); ch = getchar()) x = (x + (x << 2) << 1) + (ch ^ 48);     return x * f;   }   int main() {     n = read(), m = read(), r = read();     for (int i = 0; i <= r; i++) b[i] = sqrt(r * r - i * i);     for (int i = 0; i <= (r << 1); i++)       for (int j = max(0, i - r); j <= min(i, r); j++)         c[i] = max(c[i], b[j] + b[i - j] + 1);     for (int i = 1; i <= n; i++)       for (int j = 1; j <= m; j++)         a[i][j] = read(), s[i][j] = s[i][j - 1] + a[i][j];     for (int i = r + 1; i <= n - r; i++) {       for (int j = r + 1; j <= m - r; j++) {         mxl[i][j] = mxl[i][j - 1], sl[i][j] = sl[i][j - 1];         for (int k = i - r; k <= i + r; k++)           sm[i][j] += s[k][j + b[abs(i - k)]] - s[k][j - b[abs(i - k)] - 1];         if (sm[i][j] == mxl[i][j]) sl[i][j]++;         if (sm[i][j] > mxl[i][j]) mxl[i][j] = sm[i][j], sl[i][j] = 1;       }       for (int j = m - r; j > r; j--) {         mxr[i][j] = mxr[i][j + 1], sr[i][j] = sr[i][j + 1];         if (sm[i][j] == mxr[i][j]) sr[i][j]++;         if (sm[i][j] > mxr[i][j]) mxr[i][j] = sm[i][j], sr[i][j] = 1;       }     }     for (int i = r + 1; i <= n - r; i++)       for (int j = r + 1; j <= m - r; j++) {         int tmp = 0, t1 = 0;         for (int k = r + 1; k <= n - r; k++) {           int l = abs(k - i);           if (j - c[l] > r) {             if (mxl[k][j - c[l]] == tmp) t1 += sl[k][j - c[l]];             if (mxl[k][j - c[l]] > tmp)               tmp = mxl[k][j - c[l]], t1 = sl[k][j - c[l]];           }           if (!c[l]) j++;           if (j + c[l] <= m - r) {             if (mxr[k][j + c[l]] == tmp) t1 += sr[k][j + c[l]];             if (mxr[k][j + c[l]] > tmp)               tmp = mxr[k][j + c[l]], t1 = sr[k][j + c[l]];           }           if (!c[l]) j--;         }         if (!tmp) continue;         if (tmp + sm[i][j] == ans) t += t1;         if (tmp + sm[i][j] > ans) ans = tmp + sm[i][j], t = t1;       }     printf( %d %lld , ans, ans ? t >> 1 : 0);     return 0;   }   