#include <bits/stdc++.h>
using namespace std;
const int N = 1e5;
const int M = 7;
int n, p, k;
int s[N + 1][M + 1];
long long dp[N + 1][1 << M + 1];
pair<int, int> a[N + 1];
long long go(int idx, int mask) {
  if (idx > n) {
    if (mask == ((1 << p) - 1)) {
      return 0;
    } else {
      return -1e18;
    }
  }
  if (dp[idx][mask] != -1) {
    return dp[idx][mask];
  }
  int players = __builtin_popcount(mask);
  int aud = idx - players - 1;
  long long ans = 0;
  if (players < p) {
    for (int i = 0; i < p; i++) {
      int val = mask & (1 << i);
      if (!val) {
        ans = max(ans, 1LL * s[a[idx].second][i + 1] +
                           1LL * go(idx + 1, mask | (1 << i)));
      }
    }
  }
  if (aud < k) {
    ans = max(ans, 1LL * a[idx].first + 1LL * go(idx + 1, mask));
  } else {
    ans = max(ans, go(idx + 1, mask));
  }
  return dp[idx][mask] = ans;
}
int main() {
  cin >> n >> p >> k;
  for (int i = 1; i <= n; i++) {
    int x;
    cin >> x;
    a[i] = {x, i};
  }
  sort(a + 1, a + n + 1);
  reverse(a + 1, a + n + 1);
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= p; j++) {
      cin >> s[i][j];
    }
  }
  memset(dp, -1, sizeof(dp));
  cout << go(1, 0);
}
