#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e10;
const long long minf = -1e10;
long long n, p, k;
struct dat {
  long long a;
  long long s[7];
};
dat tmp[100005];
bool cmp(dat a, dat b) { return a.a > b.a; }
void readfile() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  if (fopen("test"
            ".inp",
            "r")) {
    freopen(
        "test"
        ".inp",
        "r", stdin);
  }
  cin >> n >> p >> k;
  for (long long i = 1; i <= n; i++) cin >> tmp[i].a;
  for (long long i = 1; i <= n; i++) {
    for (long long j = 0; j < p; j++) cin >> tmp[i].s[j];
  }
}
long long dp[100005][1 << 7];
void proc() {
  sort(tmp + 1, tmp + 1 + n, cmp);
  memset(dp, -1, sizeof dp);
  dp[0][0] = 0;
  for (long long i = 1; i <= n; i++) {
    for (long long j = 0; j < (1 << p); j++) {
      long long c = i - 1 - __builtin_popcount(j);
      if (c < k && dp[i - 1][j] != -1) dp[i][j] = dp[i - 1][j] + tmp[i].a;
      if (c >= k && dp[i - 1][j] != -1) dp[i][j] = dp[i - 1][j];
      for (long long pos = 0; pos < p; pos++) {
        if ((((j) >> (pos)) & 1) && dp[i - 1][j ^ (1 << pos)] != -1) {
          dp[i][j] = max(dp[i][j], dp[i - 1][j ^ (1 << pos)] + tmp[i].s[pos]);
        }
      }
    }
  }
  cout << dp[n][(1 << p) - 1];
}
signed main() {
  readfile();
  proc();
  return 0;
}
