#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
template <typename T>
inline T smax(T &a, const T &b) {
  return a < b ? a = b : a;
}
int n, m, r, limit[503], len[2 * 503];
;
int arr[503][503], cycle[503][503];
pair<int, long long> upper[503], le[503][503], ri[503][503];
inline void upt(pair<int, long long> &init, const pair<int, long long> val) {
  if (val.first > init.first) init = pair<int, long long>(val.first, 0);
  if (val.first == init.first) init.second += val.second;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m >> r;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) {
      cin >> arr[i][j];
      arr[i][j] += arr[i][j - 1];
    }
  for (int i = 0; i <= r; i++) limit[i] = sqrt(r * r - i * i);
  for (int i = r + 1; i <= (n - r); i++)
    for (int j = r + 1; j <= (m - r); j++)
      for (int z = -r; z <= r; z++)
        cycle[i][j] +=
            arr[i + z][j + limit[abs(z)]] - arr[i + z][j - limit[abs(z)] - 1];
  for (int i = 0; i <= 2 * r; i++)
    for (int j = max(0, i - r); j <= min(i, r); j++)
      smax(len[i], limit[j] + limit[i - j]);
  for (int i = 1; i <= n; i++) {
    upper[i] = upper[i - 1];
    for (int j = 1; j <= m; j++)
      upt(upper[i], pair<int, long long>(cycle[i][j], 1));
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      le[i][j] = le[i][j - 1];
      upt(le[i][j], pair<int, long long>(cycle[i][j], 1));
    }
    for (int j = m; j; j--) {
      ri[i][j] = ri[i][j + 1];
      upt(ri[i][j], pair<int, long long>(cycle[i][j], 1));
    }
  }
  pair<int, long long> answer(0, 0);
  for (int i = r + 1; i <= (n - r); i++)
    for (int j = r + 1; j <= (m - r); j++) {
      pair<int, long long> res(0, 0);
      for (int z = 1; z <= 2 * r && (i - z); z++) {
        if ((j - len[z] - 1) >= 1) upt(res, le[i - z][j - len[z] - 1]);
        if ((j + len[z] + 1) <= m) upt(res, ri[i - z][j + len[z] + 1]);
      }
      if ((j - 2 * r - 1) >= 1) upt(res, le[i][j - 2 * r - 1]);
      if ((i - 2 * r - 1) >= 1) upt(res, upper[i - 2 * r - 1]);
      if (res.first) res.first += cycle[i][j];
      if (res.first && res.second) upt(answer, res);
    }
  cout << answer.first << ' ' << answer.second << endl;
  return 0;
}
