#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
int n, p, k, a[N], id[N];
int S[128], v[N][8];
long long f[N][128];
bool cmp(int x, int y) { return a[x] > a[y]; }
int main() {
  scanf("%d%d%d", &n, &p, &k);
  for (int i = (int)(1); i <= (int)(n); i++) scanf("%d", &a[i]);
  for (int i = (int)(1); i <= (int)(n); i++) id[i] = i;
  sort(id + 1, id + n + 1, cmp);
  for (int i = (int)(1); i <= (int)(n); i++)
    for (int j = (int)(0); j <= (int)(p - 1); j++) scanf("%d", &v[i][j]);
  memset(f, 233, sizeof(f));
  f[0][0] = 0;
  for (int i = (int)(0); i <= (int)((1 << p) - 1); i++)
    S[i] = S[i / 2] + (i & 1);
  for (int i = (int)(1); i <= (int)(n); i++)
    for (int j = (int)(0); j <= (int)((1 << p) - 1); j++) {
      f[i][j] = max(f[i][j], f[i - 1][j] + (k + S[j] >= i ? a[id[i]] : 0));
      for (int k = (int)(0); k <= (int)(p - 1); k++)
        if (!(j & (1 << k)))
          f[i][j | (1 << k)] =
              max(f[i][j | (1 << k)], f[i - 1][j] + v[id[i]][k]);
    }
  long long ans = -(1ll << 60);
  for (int j = (int)(0); j <= (int)((1 << p) - 1); j++) ans = max(ans, f[n][j]);
  printf("%lld\n", ans);
}
