#include <bits/stdc++.h>
using namespace std;
struct node {
  long long a[8];
} p[100001];
long long n, m, k, dp[100001][1 << 7];
bool cmp(node x, node y) { return x.a[0] > y.a[0]; }
signed main() {
  cin >> n >> m >> k;
  for (long long i = 1; i <= n; i++) cin >> p[i].a[0];
  for (long long i = 1; i <= n; i++)
    for (long long l = 1; l <= m; l++) cin >> p[i].a[l];
  sort(p + 1, p + 1 + n, cmp);
  memset(dp, -1, sizeof(dp));
  dp[0][0] = 0;
  for (long long i = 1; i <= n; i++)
    for (long long l = 0; l < (1 << m); l++) {
      if (i - __builtin_popcount(l) - 1 < k) {
        if (dp[i - 1][l] != -1) dp[i][l] = dp[i - 1][l] + p[i].a[0];
      } else
        dp[i][l] = dp[i - 1][l];
      for (long long j = 1; j <= m; j++)
        if ((l & (1 << (j - 1))) && dp[i - 1][l - (1 << (j - 1))] != -1)
          dp[i][l] = max(dp[i][l], dp[i - 1][l - (1 << (j - 1))] + p[i].a[j]);
    }
  cout << dp[n][(1 << m) - 1];
  return 0;
}
