#include <bits/stdc++.h>
using namespace std;
int n, m, r;
long long cnt, ans1, ans2;
long long g[510][510], s[510][510], rec[510][510], f[510][510];
long long L[510][510], R[510][510], xL[510][510], xR[510][510];
long long dis[510], dfft[510];
int main() {
  scanf("%d%d%d", &n, &m, &r);
  if (n < 3 * r || m < 3 * r) {
    printf("0 0\n");
    return 0;
  }
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++)
      scanf("%lld", &g[i][j]), s[i][j] = s[i][j - 1] + g[i][j];
  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++) {
        int u = floor(sqrt(r * r - k * k));
        rec[i][j] += s[i + k][j + u] - s[i + k][j - u - 1];
      }
      if (rec[i][j] < L[i][j - 1])
        L[i][j] = L[i][j - 1], xL[i][j] = xL[i][j - 1];
      else if (rec[i][j] == L[i][j - 1])
        L[i][j] = L[i][j - 1], xL[i][j] = xL[i][j - 1] + 1;
      else
        L[i][j] = rec[i][j], xL[i][j] = 1;
    }
  for (int i = r + 1; i <= n - r; i++)
    for (int j = m - r; j >= r + 1; j--) {
      if (rec[i][j] < R[i][j + 1])
        R[i][j] = R[i][j + 1], xR[i][j] = xR[i][j + 1];
      else if (rec[i][j] == R[i][j + 1])
        R[i][j] = R[i][j + 1], xR[i][j] = xR[i][j + 1] + 1;
      else
        R[i][j] = rec[i][j], xR[i][j] = 1;
    }
  for (int i = 0; i <= r; i++)
    for (int j = 0; j <= r; j++)
      if (i * i + j * j <= r * r) dis[i] = j;
  for (int i = 0; i <= 2 * r; i++) {
    cnt = 0;
    for (int j = 0; j <= r; j++)
      if (i - r <= j && j <= r) cnt = max(cnt, dis[j] + dis[abs(i - j)] + 1);
    dfft[i] = cnt;
  }
  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++) {
        cnt = 0;
        if (abs(i - k) - 1 >= 2 * r) {
          cnt = rec[i][j] + L[k][m - r];
          if (cnt == ans1)
            ans2 += xL[k][m - r];
          else if (cnt > ans1)
            ans1 = cnt, ans2 = xL[k][m - r];
          continue;
        }
        int cnt1 = dfft[abs(i - k)], cnt2 = j - cnt1;
        if (cnt2 >= r + 1) {
          cnt = rec[i][j] + L[k][cnt2];
          if (cnt == ans1)
            ans2 += xL[k][cnt2];
          else if (cnt > ans1)
            ans1 = cnt, ans2 = xL[k][cnt2];
        }
        cnt2 = j + cnt1;
        if (cnt2 <= m - r) {
          cnt = rec[i][j] + R[k][cnt2];
          if (cnt == ans1)
            ans2 += xR[k][cnt2];
          else if (cnt > ans1)
            ans1 = cnt, ans2 = xR[k][cnt2];
        }
      }
  if (ans2 == 0)
    printf("0 0\n");
  else
    printf("%lld %lld", ans1, ans2 / 2);
}
