#include <bits/stdc++.h>
using namespace std;
int n, m, r, a[555][555];
int w[555], dif[1010], row[555][555], cc[555][555];
int ma_fr[555][555], ma_fr_cnt[555][555];
int ma_fl[555][555], ma_fl_cnt[555][555];
int get_row(int rr, int L, int R) { return row[rr][R] - row[rr][L - 1]; }
int main() {
  scanf("%d%d%d", &(n), &(m), &(r));
  for (int i = (1); i < (n + 1); ++i)
    for (int j = (1); j < (m + 1); ++j) scanf("%d", &(a[i][j]));
  for (int i = (1); i < (n + 1); ++i)
    for (int j = (1); j < (m + 1); ++j) row[i][j] = row[i][j - 1] + a[i][j];
  for (int i = 0; i <= r; i++) {
    int j = 0;
    while ((j + 1) * (j + 1) + i * i <= r * r) j++;
    w[i] = j;
  }
  for (int i = 0; i < (2 * r + 1); ++i) {
    int ma = 0;
    for (int j = 0; j <= r; j++) {
      if (j < i - r) continue;
      ma = max(ma, w[j] + 1 + w[abs(i - j)]);
    }
    dif[i] = ma;
  }
  for (int i = 1 + r; i <= n - r; i++) {
    for (int j = 1 + r; j <= m - r; j++) {
      for (int k = -r; k <= r; k++) {
        cc[i][j] += get_row(i + k, j - w[abs(k)], j + w[abs(k)]);
      }
      if (cc[i][j] > ma_fl[i][j - 1]) {
        ma_fl[i][j] = cc[i][j];
        ma_fl_cnt[i][j] = 1;
      } else if (cc[i][j] == ma_fl[i][j - 1]) {
        ma_fl[i][j] = cc[i][j];
        ma_fl_cnt[i][j] = ma_fl_cnt[i][j - 1] + 1;
      } else {
        ma_fl[i][j] = ma_fl[i][j - 1];
        ma_fl_cnt[i][j] = ma_fl_cnt[i][j - 1];
      }
    }
    for (int j = m - r; j >= 1 + r; j--) {
      if (cc[i][j] > ma_fr[i][j + 1]) {
        ma_fr[i][j] = cc[i][j];
        ma_fr_cnt[i][j] = 1;
      } else if (cc[i][j] == ma_fr[i][j + 1]) {
        ma_fr[i][j] = cc[i][j];
        ma_fr_cnt[i][j] = ma_fr_cnt[i][j + 1] + 1;
      } else {
        ma_fr[i][j] = ma_fr[i][j + 1];
        ma_fr_cnt[i][j] = ma_fr_cnt[i][j + 1];
      }
    }
  }
  int an1 = 0;
  long long an2 = 0;
  for (int i = 1 + r; i <= n - r; i++)
    for (int j = 1 + r; j <= m - r; j++) {
      for (int k = 1 + r; k <= n - r; k++) {
        if (abs(i - k) > 2 * r) {
          int now = cc[i][j] + ma_fr[k][1 + r];
          if (now > an1) {
            an1 = now;
            an2 = ma_fr_cnt[k][1 + r];
          } else if (now == an1) {
            an2 += ma_fr_cnt[k][1 + r];
          }
        } else {
          int dd = abs(i - k);
          int ny = j + dif[dd];
          if (ny <= m - r) {
            int now = cc[i][j] + ma_fr[k][ny];
            if (now > an1) {
              an1 = now;
              an2 = ma_fr_cnt[k][ny];
            } else if (now == an1) {
              an2 += ma_fr_cnt[k][ny];
            }
          }
          ny = j - dif[dd];
          if (ny >= 1 + r) {
            int now = cc[i][j] + ma_fl[k][ny];
            if (now > an1) {
              an1 = now;
              an2 = ma_fl_cnt[k][ny];
            } else if (now == an1) {
              an2 += ma_fl_cnt[k][ny];
            }
          }
        }
      }
    }
  printf("%d %I64d\n", an1, an2 / 2);
  return 0;
}
