#include <bits/stdc++.h>
using namespace std;
bool com(pair<int, int> x, pair<int, int> y) {
  if (x.first == y.first) return x.second < y.second;
  return x.first < y.first;
}
long long int power(long long int x, long long int y) {
  long long int prod = 1;
  while (y) {
    if (y & 1) prod = (prod * x) % 1000000007;
    x = (x * x) % 1000000007;
    y /= 2;
  }
  return prod;
}
const int N = 1e5 + 9;
long long int a[N];
bool cmp(int x, int y) { return a[x] > a[y]; }
void solve() {
  int n, p, k;
  cin >> n >> p >> k;
  for (int i = 0; i < n; i++) cin >> a[i];
  int ind[n];
  for (int i = 0; i < n; i++) ind[i] = i;
  sort(ind, ind + n, cmp);
  int skil[n][p];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < p; j++) cin >> skil[i][j];
  }
  long long int dp[n + 1][(1ll << p)];
  for (int i = 0; i <= n; i++)
    for (int j = 0; j < (1ll << p); j++) {
      dp[i][j] = -1;
    }
  dp[0][0] = 0;
  for (int i = 1; i <= n; i++) {
    int x = ind[i - 1];
    for (int mask = 0; mask < (1ll << p); mask++) {
      int y = __builtin_popcount(mask);
      int pos = i - y - 1;
      if (pos < 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 (int l = 0; l < p; l++) {
        if ((1ll << l) & mask) {
          if (dp[i - 1][mask ^ (1ll << l)] != -1)
            dp[i][mask] =
                max(dp[i - 1][mask ^ (1ll << l)] + skil[x][l], dp[i][mask]);
        }
      }
    }
  }
  cout << dp[n][(1ll << p) - 1];
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) solve();
  return 0;
}
