#include <bits/stdc++.h>
long long int num[533][533];
long long int sum[533][533];
long long int bound[533];
long long int map[533][533];
long long int dp[533][533];
long long int cc[533][533];
long long int d[533][2];
long long int tot[533][533];
long long int n, m, r;
long long int can(long long int dx, long long int dy) {
  if (dx * dx + dy * dy <= r * r)
    return 1;
  else
    return 0;
}
int main() {
  long long int i, j, k;
  long long int dx, dy, tmp, nx, ny;
  long long int max, cnt, ans, ans_cnt;
  long long int t1;
  scanf("%I64d%I64d%I64d", &n, &m, &r);
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= m; j++) {
      scanf("%I64d", &num[i][j]);
      tot[i][j] = 0;
      sum[i][j] = sum[i][j - 1] + num[i][j];
    }
  }
  d[0][0] = -r;
  d[0][1] = r;
  for (i = 1; i <= r; i++) {
    d[i][0] = d[i - 1][0];
    d[i][1] = d[i - 1][1];
    while (can(i, d[i][0]) == 0) d[i][0]++;
    while (can(i, d[i][1]) == 0) d[i][1]--;
  }
  memset(map, 0, sizeof(0));
  for (i = 0; i <= r; i++) {
    for (j = 0; j <= r; j++) {
      nx = i + j;
      ny = d[i][1] + d[j][1];
      for (k = 0; k <= ny; k++) map[nx][k] = 1;
    }
  }
  for (j = 0; j <= m; j++) {
    bound[j] = n + 1;
    for (i = n; i >= 0; i--)
      if (map[i][j] == 0)
        bound[j]--;
      else
        break;
  }
  for (i = 1 + r; i <= n - r; i++) {
    for (j = 1 + r; j <= m - r; j++) {
      for (k = i - r; k <= i + r; k++) {
        if (i > k)
          dx = i - k;
        else
          dx = k - i;
        tmp = (sum[k][j + d[dx][1]] - sum[k][j + d[dx][0] - 1]);
        tot[i][j] += tmp;
      }
    }
  }
  memset(dp, -1, sizeof(dp));
  memset(cc, 0, sizeof(cc));
  for (j = 1 + r; j <= m - r; j++) {
    dp[n - r + 1][j] = -1;
    cc[n - r + 1][j] = 0;
  }
  for (i = n - r; i >= 1 + r; i--) {
    for (j = 1 + r; j <= m - r; j++) {
      dp[i][j] = dp[i + 1][j];
      if (tot[i][j] > dp[i][j])
        dp[i][j] = tot[i][j], cc[i][j] = 1;
      else if (tot[i][j] == dp[i][j])
        cc[i][j] = cc[i + 1][j] + 1;
      else
        cc[i][j] = cc[i + 1][j];
    }
  }
  ans = 0;
  ans_cnt = 0;
  for (i = 1 + r; i <= n - r; i++) {
    for (j = 1 + r; j <= m - r; j++) {
      max = -1, cnt = 0;
      for (k = j, t1 = 0; k <= m - r; k++, t1++) {
        if (dp[i + bound[t1]][k] > max)
          max = dp[i + bound[t1]][k], cnt = cc[i + bound[t1]][k];
        else if (dp[i + bound[t1]][k] == max)
          cnt += cc[i + bound[t1]][k];
      }
      for (k = j - 1, t1 = 1; k >= 1 + r; k--, t1++) {
        if (bound[t1] != 0) {
          if (dp[i + bound[t1]][k] > max)
            max = dp[i + bound[t1]][k], cnt = cc[i + bound[t1]][k];
          else if (dp[i + bound[t1]][k] == max)
            cnt += cc[i + bound[t1]][k];
        } else {
          if (dp[i + bound[t1] + 1][k] > max)
            max = dp[i + bound[t1] + 1][k], cnt = cc[i + bound[t1] + 1][k];
          else if (dp[i + bound[t1] + 1][k] == max)
            cnt += cc[i + bound[t1] + 1][k];
        }
      }
      if (max == -1) continue;
      if (cnt == -1) continue;
      max += tot[i][j];
      if (max > ans && cnt != -1)
        ans = max, ans_cnt = cnt;
      else if (max == ans && cnt != -1)
        ans_cnt += cnt;
    }
  }
  if (ans <= 0 || ans_cnt <= 0)
    puts("0 0");
  else
    printf("%I64d %I64d\n", ans, ans_cnt);
  return 0;
}
