#include <bits/stdc++.h>
using namespace std;
const int maxn = 1 + 1e5;
long long n, p, k;
long long f[maxn][130];
struct cdv {
  long long cv, c[8];
  bool operator<(const cdv &t) const { return cv > t.cv; }
} a[maxn];
int main() {
  ios_base::sync_with_stdio(0);
  memset(f, -1, sizeof(f));
  cin >> n >> p >> k;
  for (int i = 1; i <= n; i++) cin >> a[i].cv;
  for (int i = 1; i <= n; i++)
    for (int j = 0; j < p; j++) cin >> a[i].c[j];
  sort(a + 1, a + 1 + n);
  f[0][0] = 0;
  for (int i = 1; i <= n; i++)
    for (int s = 0; s < (1 << p); s++) {
      int sl = __builtin_popcount(s);
      int x = i - sl;
      if (x < 0) continue;
      f[i][s] = f[i - 1][s];
      if (x <= k && x >= 1) {
        f[i][s] = max(f[i][s], f[i - 1][s] + a[i].cv);
      }
      for (int j = 0; j < p; j++)
        if (((s >> j) & 1))
          f[i][s] = max(f[i][s], f[i - 1][s ^ (1 << j)] + a[i].c[j]);
    }
  cout << f[n][(1 << p) - 1];
  return 0;
}
