#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using Vi = vector<int>;
using Pii = pair<int, int>;
int uplg(int n) { return 32 - __builtin_clz(n); }
int uplg(ll n) { return 64 - __builtin_clzll(n); }
void run();
int main() {
  cin.sync_with_stdio(0);
  cin.tie(0);
  cout << fixed << setprecision(18);
  run();
  return 0;
}
struct Player {
  int aud;
  int play[7];
};
void run() {
  int n, p, k;
  cin >> n >> p >> k;
  vector<Player> elems(n);
  for (auto& e : (elems)) cin >> e.aud;
  for (auto& e : (elems)) {
    for (int i = (0); i < (p); i++) cin >> e.play[i];
  }
  sort((elems).begin(), (elems).end(),
       [](const Player& l, const Player& r) { return l.aud > r.aud; });
  vector<ll> prev, cur(1 << p, -1e16);
  cur[0] = 0;
  for (int i = (0); i < (n); i++) {
    prev = cur;
    for (int mask = (0); mask < (1 << p); mask++) {
      int bits = __builtin_popcount(mask);
      if (i < k + bits) {
        cur[mask] += elems[i].aud;
      }
    }
    for (int mask = (0); mask < (1 << p); mask++) {
      for (int bit = (0); bit < (p); bit++)
        if (!((mask >> bit) & 1)) {
          int kek = mask | (1 << bit);
          cur[kek] = max(cur[kek], prev[mask] + elems[i].play[bit]);
        }
    }
  }
  ll ans = cur.back();
  cout << ans << '\n';
}
