#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
const int mod = 1e9 + 7;
const int INF = 0x3f3f3f3f;
const int dir[4][2] = {-1, 0, 1, 0, 0, -1, 0, 1};
long long qpow(long long x, long long y) {
  long long ans = 1, t = x;
  while (y > 0) {
    if (y & 1) ans *= t, ans %= mod;
    t *= t, t %= mod;
    y >>= 1;
  }
  return ans % mod;
}
int n, p, k;
long long s[N][(1 << 7) + 5], ind[N], a[N], dp[N][(1 << 7) + 5];
bool cmp(int x, int y) { return a[x] > a[y]; }
void solve() {
  cin >> n >> p >> k;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < p; j++) cin >> s[i][j];
  }
  for (int i = 1; i <= n; i++) ind[i] = i;
  sort(ind + 1, ind + 1 + n, cmp);
  for (int i = 1; i <= n; i++) {
    int x = ind[i];
    for (int j = 0; j < (1 << p); j++) {
      int cnt = 0;
      for (int z = 0; z < p; z++) {
        if ((1 << z) & j) cnt++;
      }
      if (cnt > i) continue;
      if (i - cnt > 0 && i - cnt <= k)
        dp[i][j] = dp[i - 1][j] + a[x];
      else
        dp[i][j] = dp[i - 1][j];
      for (int z = 0; z < p; z++) {
        if (j & (1 << z)) {
          dp[i][j] = max(dp[i][j], dp[i - 1][j ^ (1 << z)] + s[x][z]);
        }
      }
    }
  }
  cout << dp[n][(1 << p) - 1];
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  solve();
  return 0;
}
