#include <bits/stdc++.h>
int inp() {
  char c = getchar();
  while (c < '0' || c > '9') c = getchar();
  int sum = 0;
  while (c >= '0' && c <= '9') {
    sum = sum * 10 + c - '0';
    c = getchar();
  }
  return sum;
}
int a[510][510];
int ans[510][510];
int sum[510][510];
int max1[510][510], max2[510][510];
long long f1[510][510], f2[510][510];
long long ans1, ans2, len[510];
void update(int m, int f) {
  if (m > ans1) {
    ans2 = f;
    ans1 = m;
  } else if (m == ans1)
    ans2 += f;
}
bool check(int x, int y, int r) {
  for (int i = 0; i <= x; i++)
    for (int j = 0; j <= y; j++) {
      if ((((i) * (i)) + ((j) * (j)) <= r * r) &&
          (((x - i) * (x - i)) + ((y - j) * (y - j)) <= r * r))
        return true;
    }
  return false;
}
int main() {
  int n = inp();
  int m = inp();
  int rm = std::min(inp(), n + m);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) {
      a[i][j] = inp();
      sum[i][j] = sum[i][j - 1] + a[i][j];
    }
  for (int i = rm + 1; i <= n - rm; i++)
    for (int j = rm + 1; j <= m - rm; j++) {
      int l = 1;
      int r = m;
      for (int u = i; u >= i - rm; u--) {
        while (((i - u) * (i - u)) + ((r - j) * (r - j)) > ((rm) * (rm))) r--;
        while (((i - u) * (i - u)) + ((j - l) * (j - l)) > ((rm) * (rm))) l++;
        ans[i][j] += sum[u][r] - sum[u][l - 1];
      }
      l = 1;
      r = m;
      for (int u = i + 1; u <= i + rm; u++) {
        while (((u - i) * (u - i)) + ((r - j) * (r - j)) > ((rm) * (rm))) r--;
        while (((i - u) * (i - u)) + ((j - l) * (j - l)) > ((rm) * (rm))) l++;
        ans[i][j] += sum[u][r] - sum[u][l - 1];
      }
    }
  for (int i = rm + 1; i <= n - rm; i++) {
    for (int j = rm + 1; j <= m - rm; j++) {
      max1[i][j] = std::max(ans[i][j], max1[i][j - 1]);
      if (max1[i][j] == max1[i][j - 1]) {
        if (ans[i][j] == max1[i][j])
          f1[i][j] = f1[i][j - 1] + 1;
        else
          f1[i][j] = f1[i][j - 1];
      } else
        f1[i][j] = 1;
    }
    for (int j = m - rm; j >= rm + 1; j--) {
      max2[i][j] = std::max(ans[i][j], max2[i][j + 1]);
      if (max2[i][j] == max2[i][j + 1]) {
        if (ans[i][j] == max2[i][j])
          f2[i][j] = f2[i][j + 1] + 1;
        else
          f2[i][j] = f2[i][j + 1];
      } else
        f2[i][j] = 1;
    }
  }
  len[0] = (rm << 1);
  int lim = (rm << 1);
  for (int i = 1; i <= (rm << 1); i++) {
    len[i] = len[i - 1];
    while (!check(i, len[i], rm) && len[i] > -1) len[i]--;
    if (len[i] < 0) {
      lim = i - 1;
      break;
    }
  }
  for (int i = rm + 1; i <= n - rm; i++)
    for (int j = rm + 1; j <= m - rm; j++) {
      for (int u = rm + 1; u < i - lim; u++)
        update(max1[u][m - rm] + ans[i][j], f1[u][m - rm]);
      for (int u = i + lim + 1; u <= n - rm; u++)
        update(max1[u][m - rm] + ans[i][j], f1[u][m - rm]);
      for (int u = i; u >= i - lim && u >= rm + 1; u--) {
        int l = j - len[i - u];
        int r = j + len[i - u];
        if (l > rm + 1) update(max1[u][l - 1] + ans[i][j], f1[u][l - 1]);
        if (r < m - rm) update(max2[u][r + 1] + ans[i][j], f2[u][r + 1]);
      }
      for (int u = i + 1; u <= i + lim && u <= n - rm; u++) {
        int l = j - len[u - i];
        int r = j + len[u - i];
        if (l > rm + 1) update(max1[u][l - 1] + ans[i][j], f1[u][l - 1]);
        if (r < m - rm) update(max2[u][r + 1] + ans[i][j], f2[u][r + 1]);
      }
    }
  std::cout << ans1 << ' ' << (ans2 >> 1) << '\n';
}
