#include <bits/stdc++.h>
using namespace std;
const long long INF = (1LL << 55);
int N, M, R;
vector<pair<int, int> > circle;
int circlerow[1010];
bool plane[1010][1010];
int minrow[1010];
void get_circle() {
  for (int i = 0; i < 1010; i++)
    for (int j = 0; j < 1010; j++)
      plane[i][j] =
          (((i - 505) * (i - 505)) + ((j - 505) * (j - 505)) <= ((R) * (R)));
  for (int i = 1; i < 1009; i++)
    for (int j = 1; j < 1009; j++) {
      if (plane[i][j] && !(plane[i + 1][j] && plane[i - 1][j] &&
                           plane[i][j + 1] && plane[i][j - 1]))
        circle.push_back(pair<int, int>(i - 505, j - 505));
    }
  for (int i = 0; i <= R; i++) circlerow[i] = 0;
  for (int i = 0; i < circle.size(); i++) {
    int first = circle[i].first, second = circle[i].second;
    if (first >= 0 && second >= 0)
      circlerow[first] = max(circlerow[first], second);
  }
}
bool test(int first, int second) {
  for (int i = 0; i < circle.size(); i++) {
    if (((circle[i].first - first) * (circle[i].first - first)) +
            ((circle[i].second - second) * (circle[i].second - second)) <=
        ((R) * (R)))
      return false;
  }
  return true;
}
void get_minrows() {
  for (int first = 0; first < 1010; first++) {
    int low = -1, high = 1010;
    while (low + 1 < high) {
      int mid = (low + high) / 2;
      if (test(first, mid))
        high = mid;
      else
        low = mid;
    }
    minrow[first] = high;
  }
}
long long A[505][505];
long long sumleft[505][505];
long long circlesum[505][505];
pair<long long, long long> Max(pair<long long, long long> a,
                               pair<long long, long long> b) {
  if (a.first < b.first) return b;
  if (a.first > b.first) return a;
  if (a.first == b.first)
    return pair<long long, long long>(a.first, a.second + b.second);
}
pair<long long, long long> maxleft[505][505];
pair<long long, long long> maxright[505][505];
pair<long long, long long> numleft[505][505];
inline long long seg(int first, int cl, int cr) {
  return sumleft[first][cr] - sumleft[first][cl - 1];
}
long long get_circle_sum(int row, int col) {
  long long total = 0;
  for (int dr = -R; dr <= R; dr++) {
    total += seg(row + dr, col - circlerow[abs(dr)], col + circlerow[abs(dr)]);
  }
  return total;
}
int main() {
  cin >> N >> M >> R;
  get_circle();
  get_minrows();
  for (int i = 1; i <= N; i++)
    for (int j = 1; j <= M; j++) cin >> A[i][j];
  for (int first = 1; first <= N; first++) {
    sumleft[first][0] = 0;
    for (int second = 1; second <= M; second++)
      sumleft[first][second] = sumleft[first][second - 1] + A[first][second];
  }
  for (int first = 1; first <= N; first++)
    for (int second = 1; second <= M; second++) circlesum[first][second] = -INF;
  for (int first = R + 1; first <= N - R; first++)
    for (int second = R + 1; second <= M - R; second++)
      circlesum[first][second] = get_circle_sum(first, second);
  for (int first = 1; first <= N; first++) {
    maxleft[first][0] = pair<long long, long long>(-INF, 1);
    for (int second = 1; second <= M; second++)
      maxleft[first][second] =
          Max(maxleft[first][second - 1],
              pair<long long, long long>(circlesum[first][second], 1));
    maxright[first][M + 1] = pair<long long, long long>(-INF, 1);
    for (int second = M; second >= 1; second--)
      maxright[first][second] =
          Max(maxright[first][second + 1],
              pair<long long, long long>(circlesum[first][second], 1));
  }
  pair<long long, long long> ans = pair<long long, long long>(-INF, 1);
  for (int first = R + 1; first <= N - R; first++)
    for (int second = R + 1; second <= M - R; second++) {
      pair<long long, long long> best = pair<long long, long long>(-INF, 1);
      for (int r2 = R + 1; r2 <= N - R; r2++) {
        int dc = minrow[abs(r2 - first)];
        if (dc == 0) {
          best = Max(best, maxleft[r2][M]);
        } else {
          if (second - dc >= 1) best = Max(best, maxleft[r2][second - dc]);
          if (second + dc <= M) best = Max(best, maxright[r2][second + dc]);
        }
      }
      best.first += circlesum[first][second];
      ans = Max(ans, best);
    }
  if (ans.first <= 0)
    cout << "0 0\n";
  else
    cout << ans.first << ' ' << ans.second / 2 << endl;
  return 0;
}
