#include <bits/stdc++.h>
using namespace std;
struct ww {
  int a, b;
} tr[510][510 * 4];
int i, j, k, n, m, R, ra, an, re, ma;
int a[510][510], s[510][510], l[510 * 2], r[510 * 2], ll[510 * 2], rr[510 * 2];
long long sum, num;
inline void fail() {
  printf("0 0\n");
  exit(0);
}
void build(int p, int q, int x, int y) {
  if (x == y) {
    tr[p][q].a = s[p][x];
    tr[p][q].b = 1;
    return;
  }
  int mid = (x + y) / 2;
  build(p, q * 2, x, mid);
  build(p, q * 2 + 1, mid + 1, y);
  if (tr[p][q * 2].a > tr[p][q * 2 + 1].a)
    tr[p][q] = tr[p][q * 2];
  else
    tr[p][q] = tr[p][q * 2 + 1];
  if (tr[p][q * 2].a == tr[p][q * 2 + 1].a) tr[p][q].b += tr[p][q * 2].b;
}
void cal(int p, int q, int x, int y, int l, int r) {
  if (l <= x && y <= r) {
    if (tr[p][q].a > re)
      re = tr[p][q].a, num = tr[p][q].b;
    else if (tr[p][q].a == re)
      num += tr[p][q].b;
    return;
  }
  int mid = (x + y) / 2;
  if (l <= mid) cal(p, q * 2, x, mid, l, r);
  if (mid < r) cal(p, q * 2 + 1, mid + 1, y, l, r);
}
inline bool judge(int x, int y) {
  int i, j;
  x = abs(x), y = abs(y);
  for (i = max(0, x - ra); i <= min(ra, x); i++) {
    j = x - i + ra + 1;
    if (rr[i + ra + 1] >= ll[j] + y) return 1;
  }
  return 0;
}
int main() {
  scanf("%d%d%d", &n, &m, &ra);
  if (2 * ra + 1 > min(n, m)) fail();
  R = 2 * ra + 1;
  {
    for (i = 1; i <= R; i++) l[i] = m, r[i] = 0;
    double x = ra + 1, y = ra + 1;
    for (i = 1; i <= R; i++)
      for (j = 1; j <= R; j++)
        if (sqrt((x - i) * (x - i) + (y - j) * (y - j)) - 1e-9 < 0. + ra) {
          l[i] = min(l[i], j);
          r[i] = max(r[i], j);
        }
  }
  for (i = 1; i <= n; i++)
    for (j = 1; j <= m; j++) scanf("%d", &a[i][j]), a[i][j] += a[i][j - 1];
  {
    for (i = ra + 1; i <= n - ra; i++)
      for (j = ra + 1; j <= m - ra; j++)
        for (k = 1; k <= R; k++) {
          int x = i + (k - (ra + 1));
          int ll = max(1, j - (ra + 1) + l[k]),
              rr = min(m, j - (ra + 1) + r[k]);
          s[i][j] += a[x][rr] - a[x][ll - 1];
          ma = max(ma, s[i][j]);
        }
    for (i = 1; i <= R; i++) ll[i] = l[i], rr[i] = r[i];
  }
  R = 2 * ra;
  {
    for (i = 1; i <= R * 2 + 1; i++) l[i] = m, r[i] = 0;
    for (i = -R; i <= R; i++)
      for (j = -R; j <= R; j++)
        if (judge(i, j)) {
          l[i + R + 1] = min(l[i + R + 1], j + R + 1);
          r[i + R + 1] = max(r[i + R + 1], j + R + 1);
        }
  }
  {
    for (i = 1; i <= n; i++) build(i, 1, 1, m);
    an = sum = 0;
    for (i = 1; i <= n; i++)
      for (j = 1; j <= m; j++)
        if (s[i][j] && s[i][j] + ma >= an) {
          re = num = 0;
          for (k = 1; k <= R * 2 + 1; k++) {
            int x = i + (k - (R + 1));
            if (!(x > 0 && x <= n)) continue;
            int ll = max(1, j - (R + 1) + l[k]),
                rr = min(m, j - (R + 1) + r[k]);
            if (ll > 1) cal(x, 1, 1, m, 1, ll - 1);
            if (rr < m) cal(x, 1, 1, m, rr + 1, m);
          }
          for (k = 1; k <= i - R - 1; k++) cal(k, 1, 1, m, 1, m);
          for (k = i + R + 1; k <= n; k++) cal(k, 1, 1, m, 1, m);
          if (!re) continue;
          re += s[i][j];
          if (re > an)
            an = re, sum = num;
          else if (re == an)
            sum += num;
        }
    if (!an) fail();
    printf("%d %I64d\n", an, sum / 2);
  }
  return 0;
}
