#include <bits/stdc++.h>
using namespace std;
long n, m, r, ar[666][666];
long lim[666];
long rem;
long s[666][666];
long lj, rj, circ[777][777];
long bpref[666][666], bsuf[666][666], cpref[666][666], csuf[666][666];
long bd[666];
long bdj;
long span;
long anss, bcalc, bs;
long tj1, tj2, s1, s2, calc1, calc2;
long long anscalc;
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> m >> r;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) {
      cin >> ar[i][j];
      s[i][j] = s[i][j - 1] + ar[i][j];
    }
  for (int dx = 0; dx <= r; dx++) {
    rem = r * r - dx * dx;
    lim[dx] = sqrt(rem + 0.5);
  }
  for (int i = r + 1; i + r <= n; i++)
    for (int j = r + 1; j + r <= m; j++) {
      for (int q = i - r; q <= i + r; q++) {
        lj = j - lim[abs(i - q)];
        rj = j + lim[abs(i - q)];
        circ[i][j] += s[q][rj] - s[q][lj - 1];
      }
    }
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) {
      if (circ[i][j] > bpref[i][j - 1]) {
        bpref[i][j] = circ[i][j];
        cpref[i][j] = (circ[i][j] > 0 ? 1 : 0);
      } else if (circ[i][j] == bpref[i][j - 1]) {
        bpref[i][j] = circ[i][j];
        cpref[i][j] = (cpref[i][j - 1] + 1) * (circ[i][j] > 0);
      } else {
        bpref[i][j] = bpref[i][j - 1];
        cpref[i][j] = cpref[i][j - 1];
      }
    }
  for (int i = 1; i <= n; i++)
    for (int j = m; j; j--) {
      if (circ[i][j] > bsuf[i][j + 1]) {
        bsuf[i][j] = circ[i][j];
        csuf[i][j] = (circ[i][j] > 0 ? 1 : 0);
      } else if (circ[i][j] == bsuf[i][j + 1]) {
        bsuf[i][j] = circ[i][j];
        csuf[i][j] = (csuf[i][j + 1] + 1) * (circ[i][j] > 0);
      } else {
        bsuf[i][j] = bsuf[i][j + 1];
        csuf[i][j] = csuf[i][j + 1];
      }
    }
  for (int di = 0; di <= 500; di++) {
    bdj = 0;
    for (int j = 0; j <= r; j++) {
      if (di - j > r) continue;
      span = lim[j] + lim[di - j] + 1;
      bdj = max(bdj, span);
    }
    bd[di] = bdj;
  }
  anss = 0;
  anscalc = 0;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++)
      if (circ[i][j]) {
        bs = 0;
        bcalc = 0;
        for (int q = 1; q <= n; q++) {
          tj1 = j - bd[abs(i - q)];
          tj2 = j + bd[abs(i - q)];
          if (tj1 == tj2) --tj1;
          if (tj1 < 0) tj1 = 0;
          if (tj2 > m) tj2 = m + 1;
          s1 = bpref[q][tj1];
          s2 = bsuf[q][tj2];
          calc1 = cpref[q][tj1];
          calc2 = csuf[q][tj2];
          if (s1 > s2)
            calc2 = 0;
          else if (s1 < s2)
            calc1 = 0;
          s1 = max(s1, s2);
          calc1 += calc2;
          if (bs < s1)
            bcalc = 0;
          else if (bs > s1)
            calc1 = 0;
          bs = max(bs, s1);
          bcalc += calc1;
        }
        bs += circ[i][j];
        if (bs > anss) {
          anscalc = 0;
        }
        if (bs < anss) bcalc = 0;
        anss = max(anss, bs);
        anscalc += bcalc;
      }
  if (anscalc == 0) anss = 0;
  cout << anss << " " << anscalc / 2 << endl;
  cin.get();
  cin.get();
  return 0;
}
