#include <bits/stdc++.h>
using namespace std;
int d[510], h[510];
long long s[510][510], p[510][510], mxl[510][510], pol[510][510], mxr[510][510],
    por[510][510];
int n, m, r, x;
long long ans, cnt;
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);
      s[i][j] = s[i][j - 1] + x;
    }
  h[0] = r;
  for (int i = 1; i <= r; i++) h[i] = (int)sqrt(r * r - i * i);
  for (int i = 0; i <= 2 * r; i++)
    for (int j = 0; j <= r; j++)
      if (j >= i - r) d[i] = max(d[i], h[j] + h[abs(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; k <= r; k++)
        p[i][j] += s[i + k][j + h[abs(k)]] - s[i + k][j - h[abs(k)] - 1];
  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], pol[i][j] = pol[i][j - 1];
      if (p[i][j] > mxl[i][j])
        mxl[i][j] = p[i][j], pol[i][j] = 1;
      else if (p[i][j] == mxl[i][j])
        pol[i][j]++;
    }
  for (int i = r + 1; i <= n - r; i++)
    for (int j = m - r; j >= r + 1; j--) {
      mxr[i][j] = mxr[i][j + 1], por[i][j] = por[i][j + 1];
      if (p[i][j] > mxr[i][j])
        mxr[i][j] = p[i][j], por[i][j] = 1;
      else if (p[i][j] == mxr[i][j])
        por[i][j]++;
    }
  for (int i = r + 1; i <= n - r; i++)
    for (int j = r + 1; j <= m - r; j++) {
      long long res = p[i][j];
      for (int k = r + 1; k <= n - r; k++) {
        if (abs(k - i) >= 2 * r + 1) {
          if (res + mxl[k][m - r] > ans)
            ans = res + mxl[k][m - r], cnt = pol[k][m - r];
          else if (res + mxl[k][m - r] == ans)
            cnt += pol[k][m - r];
          continue;
        }
        if (j - d[abs(k - i)] >= r + 1) {
          if (res + mxl[k][j - d[abs(k - i)]] > ans)
            ans = res + mxl[k][j - d[abs(k - i)]],
            cnt = pol[k][j - d[abs(k - i)]];
          else if (res + mxl[k][j - d[abs(k - i)]] == ans)
            cnt += pol[k][j - d[abs(k - i)]];
        }
        if (j + d[abs(k - i)] <= m - r) {
          if (res + mxr[k][j + d[abs(k - i)]] > ans)
            ans = res + mxr[k][j + d[abs(k - i)]],
            cnt = por[k][j + d[abs(k - i)]];
          else if (res + mxr[k][j + d[abs(k - i)]] == ans)
            cnt += por[k][j + d[abs(k - i)]];
        }
      }
    }
  printf("%lld %lld", ans, cnt >> 1);
  return 0;
}
