#include <bits/stdc++.h>
using namespace std;
struct Node {
  int a, s[7];
} t[200086];
inline bool cmp(Node x, Node y) { return x.a > y.a; }
int n, p, k;
long long f[200086][128];
int main() {
  scanf("%d%d%d", &n, &p, &k);
  for (int i = 1; i <= n; i++) scanf("%d", &t[i].a);
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < p; j++) {
      scanf("%d", &t[i].s[j]);
    }
  }
  sort(t + 1, t + 1 + n, cmp);
  int sup = (1 << p) - 1;
  memset(f, -0x3f, sizeof(f));
  f[0][0] = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j <= sup; j++) {
      for (int l = 0; l < p; l++) {
        if (j & (1 << l)) {
          f[i][j] = max(f[i][j], f[i - 1][j ^ (1 << l)] + t[i].s[l]);
        }
      }
      int x = j, cnt = 0;
      while (x) {
        if (x & 1) ++cnt;
        x >>= 1;
      }
      f[i][j] = max(f[i][j], f[i - 1][j] + (i - cnt <= k ? t[i].a : 0));
    }
  }
  printf("%lld", f[n][sup]);
}
