#include <bits/stdc++.h>
using namespace std;
const long long oo = 1e12;
const int Mxn = 1e5 + 5;
const int Mxp = 8;
int n, p, k;
int a[Mxn];
int s[Mxn][Mxp];
int ind[Mxn];
long long dp[Mxn][1 << Mxp];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  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 + n + 1, [&](int i, int j) { return a[i] > a[j]; });
  memset(dp, -1, sizeof dp);
  dp[0][0] = 0;
  for (int i = 1; i <= n; i++) {
    int x = ind[i];
    for (int msk = 0; msk < (1 << p); msk++) {
      int r = __builtin_popcount(msk);
      int z = (i - 1) - r;
      if (z < k) {
        if (dp[i - 1][msk] != -1) dp[i][msk] = dp[i - 1][msk] + a[x];
      } else {
        if (dp[i - 1][msk] != -1) dp[i][msk] = dp[i - 1][msk];
      }
      for (int j = 0; j < p; j++) {
        if (((msk >> j) & 1) && dp[i - 1][msk ^ (1 << j)] != -1) {
          dp[i][msk] = max(dp[i][msk], dp[i - 1][msk ^ (1 << j)] + s[x][j]);
        }
      }
    }
  }
  cout << dp[n][(1 << p) - 1] << endl;
  return 0;
}
