#include <bits/stdc++.h>
using namespace std;
long long int n, p, k;
long long int dp[100005][(1 << 7) + 5];
long long int go(long long int pos, long long int mask,
                 vector<pair<long long int, vector<long long int>>>& v) {
  if (pos == n) {
    return 0;
  }
  if (dp[pos][mask] != -1) {
    return dp[pos][mask];
  }
  long long int ans = 0;
  long long int pos_aud_left = k - (pos - __builtin_popcount(mask));
  if (pos_aud_left > 0) {
    ans = max(ans, v[pos].first + go(pos + 1, mask, v));
  } else {
    ans = max(ans, go(pos + 1, mask, v));
  }
  for (long long int i = 0; i < p; i++) {
    if (!(mask & (1 << i))) {
      ans = max(ans, v[pos].second[i] + go(pos + 1, mask | (1 << i), v));
    }
  }
  return dp[pos][mask] = ans;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> p >> k;
  vector<pair<long long int, vector<long long int>>> v(n);
  for (long long int i = 0; i < n; i++) {
    cin >> v[i].first;
  }
  for (long long int i = 0; i < n; i++) {
    vector<long long int> x(p);
    for (long long int j = 0; j < p; j++) {
      cin >> x[j];
    }
    v[i].second = x;
  }
  sort(v.begin(), v.end());
  reverse(v.begin(), v.end());
  memset(dp, -1, sizeof(dp));
  cout << go(0, 0, v) << "\n";
}
