#include <bits/stdc++.h>
using namespace std;
const long long maxn = 100005;
long long dp[maxn][256];
void solve() {
  long long n, p, k, t;
  cin >> n >> p >> k;
  vector<pair<long long, vector<long long>>> a(n + 1);
  for (long long i = (1); i <= (n); i++)
    cin >> a[i].first, a[i].second.emplace_back(0);
  for (long long i = (1); i <= (n); i++)
    for (long long _ = (1); _ <= (p); _++)
      cin >> t, a[i].second.emplace_back(t);
  sort(a.begin() + 1, a.end(),
       std::greater<pair<long long, vector<long long>>>());
  for (long long i = (0); i <= (n); i++)
    for (long long pl = (0); pl <= ((1ll << p) - 1); pl++) dp[i][pl] = -1e17;
  dp[0][0] = 0;
  for (long long i = (1); i <= (n); i++)
    for (long long pl = (0); pl <= ((1ll << p) - 1); pl++) {
      for (long long t = (0); t <= (p - 1); t++)
        if (pl & (1ll << t))
          dp[i][pl] =
              max(dp[i][pl], dp[i - 1][pl ^ (1ll << t)] + a[i].second[t + 1]);
      dp[i][pl] =
          max(dp[i][pl],
              dp[i - 1][pl] +
                  ((i - __builtin_popcountll(pl) <= k) ? (a[i].first) : (0)));
    }
  cout << dp[n][(1ll << p) - 1] << endl;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long T = 1;
  while (T--) solve();
  return 0;
}
