#include <bits/stdc++.h>
using namespace std;
const long long int M = 1e5 + 5;
long long int dp[M][(1 << 7) + 1], skill[M][7];
long long int ind[M], a[M];
bool cmp(long long int p, long long int q) { return a[p] > a[q]; }
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int n, p, k;
  cin >> n >> p >> k;
  memset(dp, -1, sizeof(dp));
  for (long long int i = 1; i <= n; i++) cin >> a[i];
  for (long long int i = 1; i <= n; i++)
    for (long long int j = 0; j < p; j++) cin >> skill[i][j];
  for (long long int i = 1; i <= n; i++) ind[i] = i;
  sort(ind + 1, ind + n + 1, cmp);
  dp[0][0] = 0;
  for (long long int i = 1; i <= n; i++) {
    long long int x = ind[i];
    for (long long int mask = 0; mask < (1 << p); mask++) {
      long long int ct = 0;
      for (long long int j = 0; j < p; j++)
        if ((mask & (1 << j))) ct++;
      long long int z = (i - 1) - ct;
      if (z < k) {
        if (dp[i - 1][mask] != -1) dp[i][mask] = dp[i - 1][mask] + a[x];
      } else {
        if (dp[i - 1][mask] != -1) dp[i][mask] = dp[i - 1][mask];
      }
      for (long long int j = 0; j < p; j++) {
        if ((mask & (1 << j)) && dp[i - 1][(mask ^ (1 << j))] != -1) {
          long long int z = dp[i - 1][(mask ^ (1 << j))] + skill[x][j];
          if (z > dp[i][mask]) dp[i][mask] = z;
        }
      }
    }
  }
  cout << dp[n][(1 << p) - 1] << "\n";
  return 0;
}
