#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void read(T &ret) {
  char c;
  int sgn;
  if (c = getchar(), c == EOF) return;
  while (c != '-' && (c < '0' || c > '9')) c = getchar();
  sgn = (c == '-') ? -1 : 1;
  ret = (c == '-') ? 0 : (c - '0');
  while (c = getchar(), c >= '0' && c <= '9') ret = ret * 10 + (c - '0');
  ret *= sgn;
  return;
}
inline void out(long long x) {
  if (x > 9) out(x / 10);
  putchar(x % 10 + '0');
}
const int maxn = 100010;
const int maxp = (1 << 7) + 10;
long long dp[maxn][maxp];
struct NODE {
  long long a;
  long long ss[10];
  bool friend operator<(NODE a, NODE b) { return a.a > b.a; }
};
NODE node[maxn];
bool cmp(int a, int b) { return a > b; }
int main() {
  memset(dp, -1, sizeof(dp));
  int n, p, k;
  read(n), read(p), read(k);
  for (int i = 1; i <= n; i++) read(node[i].a);
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < p; j++) {
      read(node[i].ss[j]);
    }
  }
  sort(node + 1, node + n + 1);
  dp[0][0] = 0;
  for (int i = 1; i <= n; i++) {
    for (int s = 0; s < (1 << p); s++) {
      int tot = __builtin_popcount(s);
      if (dp[i - 1][s] != -1) dp[i][s] = dp[i - 1][s];
      int x = (i - 1) - tot;
      if (x < k) {
        if (dp[i][s] != -1) dp[i][s] += node[i].a;
      }
      for (int j = 0; j < p; j++) {
        if ((s & (1 << j)) && dp[i - 1][(s ^ (1 << j))] != -1) {
          dp[i][s] = max(dp[i][s], dp[i - 1][(s ^ (1 << j))] + node[i].ss[j]);
        }
      }
    }
  }
  out(dp[n][(1 << p) - 1]);
  return 0;
}
