#include <bits/stdc++.h>
using namespace std;
const int N = 510;
int inf = 1e9;
int mod = 1e9 + 7;
void f(int &x, long long int &y, int a, long long int b) {
  if (a > x) {
    x = a;
    y = b;
  } else if (x == a) {
    y += b;
  }
}
int s[N][N], maxi[N][N];
long long int cnt[N][N];
int R1[N], R2[N];
int val[N][N];
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m, r;
  cin >> n >> m >> r;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      int x;
      cin >> x;
      s[i][j] = s[i][j - 1] + x;
    }
  }
  for (int i = 0; i <= n; i++) {
    for (int j = 0; j <= m; j++) {
      maxi[i][j] = -inf;
    }
  }
  for (int i = 0; i <= r; i++) {
    int j = r;
    while (j * j + i * i > r * r) {
      j--;
    }
    R1[i] = j;
  }
  for (int i = 0; i <= 2 * r; i++) {
    for (int j = max(i - r, 0); j <= i && j <= r; j++) {
      R2[i] = max(R2[i], R1[i - j] + R1[j] + 1);
    }
  }
  int ans1 = 0;
  long long int ans2 = 0;
  for (int i = r + 1; i <= n - r; i++) {
    for (int j = r + 1; j <= m - r; j++) {
      for (int k = 0; k <= r; k++) {
        val[i][j] += s[i + k][j + R1[k]] - s[i + k][j - R1[k] - 1];
        if (k) {
          val[i][j] += s[i - k][j + R1[k]] - s[i - k][j - R1[k] - 1];
        }
      }
      maxi[i][j] = maxi[i][j - 1];
      cnt[i][j] = cnt[i][j - 1];
      f(maxi[i][j], cnt[i][j], val[i][j], 1LL);
    }
  }
  for (int i = r + 1; i <= n - r; i++) {
    for (int j = r + 1; j <= m - r; j++) {
      for (int k = r + 1; k <= i + 2 * r && k <= n; k++) {
        if (i - k > 2 * r) {
          f(ans1, ans2, val[i][j] + maxi[k][m - r], cnt[k][m - r]);
        } else if (j - R2[abs(i - k)] >= r + 1) {
          f(ans1, ans2, val[i][j] + maxi[k][j - R2[abs(i - k)]],
            cnt[k][j - R2[abs(i - k)]]);
        }
      }
    }
  }
  cout << ans1 << " " << ans2 << "\n";
  return 0;
}
