#include <bits/stdc++.h>
using namespace std;
const long long siz = 1e5 + 5, len = (1 << 7) + 10;
long long t, n, p, m, k, a[siz], pos[siz], dp[siz][len], skill[siz][7];
bool cmp(long long x, long long y) { return a[x] > a[y]; }
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> p >> k;
  for (long long i = 1; i <= n; i++) cin >> a[i], pos[i] = i;
  for (long long i = 1; i <= n; i++)
    for (long long j = 0; j < p; j++) cin >> skill[i][j];
  sort(pos + 1, pos + 1 + n, cmp);
  memset(dp, -1, sizeof dp);
  dp[0][0] = 0;
  for (long long i = 1; i <= n; i++) {
    long long ind = pos[i];
    for (long long mask = 0; mask < (1LL << p); mask++) {
      long long taken = __builtin_popcount(mask);
      long long lft = i - 1 - taken;
      if (lft < k) {
        if (dp[i - 1][mask] != -1) dp[i][mask] = dp[i - 1][mask] + a[ind];
      } else {
        if (dp[i - 1][mask] != -1) dp[i][mask] = dp[i - 1][mask];
      }
      for (long long j = 0; j < p; j++) {
        if ((mask & (1LL << j)) and dp[i - 1][(mask ^ (1LL << j))] != -1) {
          long long cur = skill[ind][j] + dp[i - 1][(mask ^ (1LL << j))];
          dp[i][mask] = max(dp[i][mask], cur);
        }
      }
    }
  }
  cout << dp[n][(1LL << p) - 1] << endl;
}
