#include <bits/stdc++.h>
using namespace std;
template <class T>
void mxi(T &a, const T &b) {
  a = max(a, b);
}
template <class T>
void mni(T &a, const T &b) {
  a = min(a, b);
}
long double EPS = 1e-9;
long long dp[100100][130];
pair<long long, long long> ar[100100];
long long s[100100][8], k, n, p;
long long go(long long x, long long mask) {
  if (x == n && (mask == ((1 << p) - 1)) && x - p >= k) {
    return 0;
  } else if (x == n) {
    return -1e18;
  }
  long long y = __builtin_popcount(mask);
  assert(x >= y);
  if (dp[x][mask] == -1) {
    long long &e = dp[x][mask];
    e = 0;
    if (x - y < k) {
      e = ar[x].first + go(x + 1, mask);
    }
    if (y < p) {
      for (long long i = 0; i < p; i++) {
        if ((mask & (1 << i)) == 0) {
          mxi(e, s[ar[x].second][i] + go(x + 1, mask | (1 << i)));
        }
      }
    }
    if (x - y >= k) {
      mxi(e, go(x + 1, mask));
    }
  }
  return dp[x][mask];
}
void solve() {
  memset(dp, -1, sizeof(dp));
  cin >> n >> p >> k;
  long long tmp;
  for (long long i = 0; i < (n); i++) {
    cin >> tmp;
    ar[i] = {tmp, i};
  }
  sort(ar, ar + n, greater<pair<long long, long long> >());
  for (long long i = 0; i < (n); i++) {
    for (long long j = 0; j < (p); j++) cin >> s[i][j];
  }
  cout << go(0, 0) << '\n';
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t, tab;
  t = 1;
  tab = t;
  while (t--) {
    solve();
  }
}
