#include <bits/stdc++.h>
using namespace std;
int n, m, r;
vector<vector<int> > cell(510, vector<int>(510, 0));
vector<vector<int> > accum(510, vector<int>(510, 0));
vector<vector<int> > circle(510, vector<int>(510, 0));
vector<vector<pair<int, int> > > statL, statR;
vector<int> width;
vector<int> offset;
int Around(int row, int col) {
  int b = col - width[0];
  int e = col + width[0];
  int ans = accum[row][e] - accum[row][b - 1];
  for (int di = 1; di <= r; ++di) {
    b = col - width[di];
    e = col + width[di];
    ans += accum[row - di][e] - accum[row - di][b - 1];
    ans += accum[row + di][e] - accum[row + di][b - 1];
  }
  return ans;
}
void Init() {
  width.clear();
  width.resize(r + 1);
  int r2 = r * r;
  for (int di = 0; di <= r; ++di) {
    width[di] = (int)sqrt(r2 - di * di);
  }
  int maxDi = r + r;
  offset.clear();
  offset.resize(maxDi + 1);
  for (int di = 0; di <= maxDi; ++di) {
    int maxD = min(di, r);
    int maxOffset = 0;
    for (int d = 0; d <= maxD; ++d) {
      if (di - d > r) continue;
      maxOffset = max(maxOffset, width[di - d] + width[d] + 1);
    }
    offset[di] = maxOffset;
  }
  pair<int, int> val(0, 0);
  statL.assign(n + 1, vector<pair<int, int> >(m + 5, val));
  statR.assign(n + 1, vector<pair<int, int> >(m + 5, val));
  for (int i = r + 1; i <= n - r; ++i) {
    for (int j = r + 1; j <= m - r; ++j) {
      circle[i][j] = Around(i, j);
      statL[i][j] = statL[i][j - 1];
      int temp = statL[i][j].first;
      if (circle[i][j] == temp)
        ++statL[i][j].second;
      else if (circle[i][j] > temp)
        statL[i][j] = make_pair(circle[i][j], 1);
    }
  }
  for (int i = r + 1; i <= n - r; ++i) {
    for (int j = m - r; j >= r + 1; --j) {
      statR[i][j] = statR[i][j + 1];
      if (circle[i][j] == statR[i][j].first)
        ++statR[i][j].second;
      else if (circle[i][j] > statR[i][j].first)
        statR[i][j] = make_pair(circle[i][j], 1);
    }
  }
}
void Work() {
  int ans = 0;
  long long num = 0;
  for (int i = r + 1; i <= n - r; ++i) {
    for (int j = r + 1; j <= m - r; ++j) {
      int temp = 0, temp_num = 0;
      for (int ii = i; ii <= n - r; ++ii) {
        int di = ii - i;
        int offsetVal = (di < offset.size() ? offset[di] : 0);
        int jl = j - offsetVal;
        int jr = j + offsetVal;
        jl == jr ? --jl : NULL;
        if (di && jl >= r + 1) {
          if (temp < statL[ii][jl].first) {
            temp = statL[ii][jl].first;
            temp_num = statL[ii][jl].second;
          } else if (temp == statL[ii][jl].first)
            temp_num += statL[ii][jl].second;
        }
        if (jr <= m - r) {
          if (temp < statR[ii][jr].first) {
            temp = statR[ii][jr].first;
            temp_num = statR[ii][jr].second;
          } else if (temp == statR[ii][jr].first)
            temp_num += statR[ii][jr].second;
        }
      }
      if (!temp_num) continue;
      if (ans < temp + circle[i][j]) {
        ans = temp + circle[i][j];
        num = temp_num;
      } else if (ans == temp + circle[i][j])
        num += temp_num;
    }
  }
  cout << ans << " " << num << endl;
}
int main() {
  while (cin >> n >> m >> r) {
    for (int i = 1; i <= n; ++i) {
      for (int j = 1; j <= m; ++j) {
        cin >> cell[i][j];
        accum[i][j] = accum[i][j - 1] + cell[i][j];
      }
    }
    Init();
    Work();
  }
  return 0;
}
