#include <bits/stdc++.h>
using namespace std;
int n, p, k, a[200005], sk[200005][8], id[200005];
long long dp[200005][(1 << 7) + 5];
bool cmp(int x, int y) { return a[x] > a[y]; }
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> p >> k;
  for (long long i = (long long)1; i <= (long long)n; i++) cin >> a[i];
  for (long long i = (long long)1; i <= (long long)n; i++)
    for (long long j = (long long)0; j <= (long long)p - 1; j++)
      cin >> sk[i][j];
  for (long long i = (long long)1; i <= (long long)n; i++) id[i] = i;
  sort(id + 1, id + n + 1, cmp);
  memset(dp, -1, sizeof dp);
  dp[0][0] = 0;
  for (long long i = (long long)1; i <= (long long)n; i++) {
    int x = id[i];
    for (long long m = (long long)0; m <= (long long)(1 << p) - 1; m++) {
      if (dp[i - 1][m] != -1) {
        int ina = i - 1;
        for (long long j = (long long)0; j <= (long long)p - 1; j++)
          if (m & (1 << j)) ina--;
        if (ina < k)
          dp[i][m] = dp[i - 1][m] + a[x];
        else
          dp[i][m] = dp[i - 1][m];
      }
      for (long long j = (long long)0; j <= (long long)p - 1; j++)
        if ((m & (1 << j)) and dp[i - 1][m ^ (1 << j)] != -1) {
          dp[i][m] = max(dp[i][m], dp[i - 1][m ^ (1 << j)] + sk[x][j]);
        }
    }
  }
  cout << dp[n][(1 << p) - 1];
}
