#include <bits/stdc++.h>
using namespace std;
int n, p, k;
long long dp[2][128];
pair<long long, vector<long long> > ply[100100];
long long vv;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> p >> k;
  for (int i = 1; i <= n; i++) cin >> ply[i].first;
  for (int i = 1; i <= n; i++)
    for (int j = 0; j < p; j++) {
      cin >> vv;
      ply[i].second.push_back(vv);
    }
  sort(ply + 1, ply + n + 1);
  reverse(ply + 1, ply + n + 1);
  int cur, lst;
  for (int j = 0; j < (1 << p); j++) dp[cur][j] = 0LL;
  for (int i = 1; i <= n; i++) {
    cur = i % 2;
    lst = (i - 1) % 2;
    for (int j = 0; j < (1 << p); j++) dp[cur][j] = 0LL;
    for (int j = 0; j < (1 << p); j++) {
      if (__builtin_popcount(j) > i) continue;
      for (int kk = 0; kk < p; kk++) {
        if ((!(j & (1 << kk)))) continue;
        dp[cur][j] =
            max(dp[cur][j], (dp[lst][(j ^ (1 << kk))] + ply[i].second[kk]));
      }
      if (__builtin_popcount(j) + k < i) {
        dp[cur][j] = max(dp[cur][j], dp[lst][j]);
        continue;
      }
      if (__builtin_popcount(j) >= i) continue;
      dp[cur][j] = max(dp[cur][j], dp[lst][j] + ply[i].first);
    }
  }
  cout << dp[n % 2][(1 << p) - 1] << endl;
  return 0;
}
