#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
const int M = 7;
const int S = 1 << 7;
int _w;
struct Ele {
  int s[M], v;
  bool operator<(const Ele& rhs) const { return v < rhs.v; }
} dat[N];
int n, m, k, cnt[S];
long long f[N][S], ans;
int main(void) {
  _w = scanf("%d%d%d", &n, &m, &k);
  for (int i = 1; i <= n; ++i) _w = scanf("%d", &dat[i].v);
  for (int i = 1; i <= n; ++i)
    for (int j = 0; j < m; ++j) _w = scanf("%d", &dat[i].s[j]);
  sort(dat + 1, dat + 1 + n);
  reverse(dat + 1, dat + 1 + n);
  memset(f, -127, sizeof f);
  int ls = (1 << m);
  for (int i = 1; i < ls; ++i) cnt[i] = cnt[i ^ (i & (-i))] + 1;
  f[0][0] = 0;
  for (int i = 1; i <= n; ++i) {
    for (int s = 0; s < ls; ++s)
      if (f[i - 1][s] >= 0) {
        if (i - cnt[s] - 1 < k)
          f[i][s] = max(f[i][s], f[i - 1][s] + dat[i].v);
        else
          f[i][s] = max(f[i][s], f[i - 1][s]);
        for (int j = 0; j < m; ++j)
          if ((~s >> j) & 1)
            f[i][s ^ (1 << j)] =
                max(f[i][s ^ (1 << j)], f[i - 1][s] + dat[i].s[j]);
      }
  }
  cout << f[n][ls - 1];
  return 0;
}
