#include <bits/stdc++.h>
struct ast {
  int idx;
  int val;
  int s[7];
  bool operator>(const ast &b) const { return (this->val > b.val); }
  bool operator<(const ast &b) const { return (this->val < b.val); }
  bool operator==(const ast &b) const { return (this->val < b.val); }
};
int n, p, k;
ast a[100000];
long long dp[100000][128];
long long dfs(int idx, int bitmask) {
  if (idx == n) {
    if (bitmask != ((1 << p) - 1)) {
      return -2;
    }
    return 0;
  }
  if (dp[idx][bitmask] != -1) {
    return dp[idx][bitmask];
  }
  long long r = -2;
  int cnt = 0;
  for (int j = 0; j < p; j++) {
    int b = (1 << j);
    if ((bitmask & b) == 0) {
      long long sr = dfs(idx + 1, bitmask | b);
      if (sr != -2) {
        r = std::max(r, a[idx].s[j] + sr);
      }
    } else {
      cnt++;
    }
  }
  if (cnt + k > idx) {
    long long sr = dfs(idx + 1, bitmask);
    if (sr != -2) {
      r = std::max(r, a[idx].val + sr);
    }
  } else {
    r = std::max(r, dfs(idx + 1, bitmask));
  }
  dp[idx][bitmask] = r;
  return r;
}
int main() {
  scanf("%d%d%d", &n, &p, &k);
  for (int i = 0; i < n; i++) {
    a[i].idx = i;
    scanf("%d", &a[i].val);
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < p; j++) {
      scanf("%d", &a[i].s[j]);
    }
  }
  sort(a, a + n, std::greater<ast>());
  memset(dp, -1, sizeof(dp[0][0]) * n * 128);
  long long res = dfs(0, 0);
  printf("%lld\n", res);
}
