#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10, maxp = (1 << 7);
int n, p, k, a[maxn], mat[maxn][maxp], poss[maxn];
pair<int, int> comp[maxn];
long long dp[maxn][maxp];
long long solve(int pos, int mask, int qtd) {
  if (pos > n) return 0;
  if (dp[pos][mask] != -1) return dp[pos][mask];
  if (mask == (1 << p) - 1 and qtd == k) return 0;
  long long tot;
  if (qtd < k)
    tot = a[poss[pos]] + solve(pos + 1, mask, qtd + 1);
  else
    tot = solve(pos + 1, mask, qtd);
  for (int i = 0; i < p; i++) {
    if (!((1 << i) & mask)) {
      tot = max(tot, 1LL * mat[poss[pos]][i + 1] +
                         solve(pos + 1, mask ^ (1 << i), qtd));
    }
  }
  return dp[pos][mask] = tot;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> p >> k;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    comp[i].first = a[i];
    comp[i].second = i;
  }
  sort(comp + 1, comp + n + 1);
  reverse(comp + 1, comp + n + 1);
  for (int i = 1; i <= n; i++) {
    poss[i] = comp[i].second;
    for (int j = 1; j <= p; j++) {
      cin >> mat[i][j];
    }
  }
  memset(dp, -1, sizeof dp);
  cout << solve(1, 0, 0) << endl;
  return 0;
}
