#include <bits/stdc++.h>
template <class T>
inline void rd(T &x) {
  char c = getchar(), f = 0;
  x = 0;
  while (!isdigit(c)) f = (c == '-'), c = getchar();
  while (isdigit(c)) x = x * 10 + c - '0', c = getchar();
  x = f ? -x : x;
}
const int MAXN = 1e5 + 7;
long long f[2][(1 << 7) + 7];
int n, p, k;
struct Node {
  long long a, b[20];
  Node() {
    a = 0;
    for (int i = (0); i <= (19); ++i) b[i] = 0;
  }
  bool operator<(const Node &other) const { return a > other.a; }
} a[MAXN];
template <class T>
inline void upd(T &a, T b) {
  a = (b > a ? b : a);
}
int main() {
  rd(n), rd(p), rd(k);
  for (int i = (1); i <= (n); ++i) rd(a[i].a);
  for (int i = (1); i <= (n); ++i)
    for (int j = (0); j <= (p - 1); ++j) rd(a[i].b[j]);
  std::sort(a + 1, a + n + 1);
  for (int i = (0); i <= (1); ++i)
    for (int j = (0); j <= ((1 << p) - 1); ++j) f[i][j] = LLONG_MIN;
  f[0][0] = 0;
  for (int i = (1); i <= (n); ++i) {
    int w = i & 1;
    for (int s = (0); s <= ((1 << p) - 1); ++s) {
      f[w][s] = LLONG_MIN;
      for (int j = (0); j <= (p - 1); ++j)
        if (s & (1 << j)) upd(f[w][s], f[w ^ 1][s ^ (1 << j)] + a[i].b[j]);
      upd(f[w][s],
          f[w ^ 1][s] + (__builtin_popcount(s) + k >= i ? a[i].a : 0ll));
    }
  }
  printf("%lld\n", f[n & 1][(1 << p) - 1]);
  return 0;
}
