#include <bits/stdc++.h>
const int maxN = 502;
int m, n, r;
int x[maxN][maxN];
int d[maxN];
int d2[maxN];
int s[maxN][maxN];
int ls[maxN][maxN];
int lmaxV[maxN][maxN];
long long lmaxQ[maxN][maxN];
int foundMax = -1;
long long foundQ = 0;
inline int iabs(int x) { return x >= 0 ? x : -x; }
inline int imax(int x, int y) { return x > y ? x : y; }
inline int imin(int x, int y) { return x < y ? x : y; }
int main() {
  scanf("%d%d%d", &n, &m, &r);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) scanf("%d", &x[i][j]);
  for (int i = 1; i <= n; i++) {
    ls[i][0] = 0;
    for (int j = 1; j <= m; j++) {
      ls[i][j] = ls[i][j - 1] + x[i][j];
      s[i][j] = -1;
    }
  }
  for (int i = 0; i <= r; i++)
    d[i] = (int)(0.000001 + sqrt(double((r * r) - i * i)));
  for (int i = 0; i <= (r << 1); i++) {
    d2[i] = -1;
    for (int j = imax(0, i - r); j <= r; j++)
      if (d[j] + d[iabs(i - j)] > d2[i]) d2[i] = d[j] + d[iabs(i - j)];
  }
  for (int i = r + 1; i <= n - r; i++) {
    for (int j = r + 1; j <= m - r; j++) {
      s[i][j] = 0;
      for (int l = 0; l <= r; l++) {
        s[i][j] += ls[i + l][j + d[l]] - ls[i + l][j - d[l] - 1];
        if (l) s[i][j] += ls[i - l][j + d[l]] - ls[i - l][j - d[l] - 1];
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    lmaxV[i][0] = -1;
    lmaxQ[i][0] = 0;
    for (int j = 1; j <= m; j++) {
      if (s[i][j] > lmaxV[i][j - 1]) {
        lmaxV[i][j] = s[i][j];
        lmaxQ[i][j] = 1;
      } else if (s[i][j] == lmaxV[i][j - 1]) {
        lmaxQ[i][j] = lmaxQ[i][j - 1] + 1;
        lmaxV[i][j] = s[i][j];
      } else {
        lmaxV[i][j] = lmaxV[i][j - 1];
        lmaxQ[i][j] = lmaxQ[i][j - 1];
      }
    }
  }
  for (int i = r + 1; i <= n - r; i++) {
    for (int j = r + 1; j <= m - r; j++) {
      for (int k = r + 1; k <= n - r; k++) {
        if (iabs(i - k) > (r << 1)) {
          if (s[i][j] + lmaxV[k][j] > foundMax) {
            foundMax = s[i][j] + lmaxV[k][j];
            foundQ = lmaxQ[k][j];
          } else if (foundMax == s[i][j] + lmaxV[k][j]) {
            foundQ += lmaxQ[k][j];
          }
          if (i > k && foundMax == s[i][j] + s[k][j]) foundQ--;
        } else {
          int jj = j - d2[iabs(i - k)] - 1;
          if (jj > r) {
            if (s[i][j] + lmaxV[k][jj] > foundMax) {
              foundMax = s[i][j] + lmaxV[k][jj];
              foundQ = lmaxQ[k][jj];
            } else if (s[i][j] + lmaxV[k][jj] == foundMax)
              foundQ += lmaxQ[k][jj];
          }
        }
      }
    }
  }
  if (foundMax > 0) {
    printf("%d %I64d\n", foundMax, foundQ);
  } else {
    printf("0 0\n");
  }
  return 0;
}
