#include <bits/stdc++.h>
using namespace std;
template <typename T, typename L>
bool smax(T& x, L y) {
  return x < y ? x = y, true : false;
}
const long long MAXN = 1e5 + 15, MAXP = 8;
struct Human {
  long long a;
  long long s[MAXP];
};
long long dp[MAXN][(1 << MAXP)];
Human inp[MAXN];
long long n, k, p;
int32_t main() {
  cin >> n >> p >> k;
  for (long long i = 1; i <= n; i++) cin >> inp[i].a;
  for (long long i = 1; i <= n; i++)
    for (long long j = 0; j < p; j++) cin >> inp[i].s[j];
  sort(inp + 1, inp + n + 1, [](Human x, Human y) { return y.a < x.a; });
  for (long long mask = 1; mask < (1 << p); mask++) dp[0][mask] = -1e18;
  for (long long i = 1; i <= n; i++)
    for (long long mask = 0; mask < (1 << p); mask++) {
      long long cnt = __builtin_popcount(mask);
      if (i <= k + cnt) {
        if (i < cnt)
          dp[i][mask] = -1e18;
        else {
          for (long long j = 0; j < p; j++)
            if (mask >> j & 1)
              smax(dp[i][mask], dp[i - 1][mask ^ (1 << j)] + inp[i].s[j]);
          smax(dp[i][mask], dp[i - 1][mask] + inp[i].a);
        }
      } else {
        dp[i][mask] = dp[i - 1][mask];
        for (long long j = 0; j < p; j++)
          if (mask >> j & 1)
            smax(dp[i][mask], dp[i - 1][mask ^ (1 << j)] + inp[i].s[j]);
      }
    }
  return cout << dp[n][(1 << p) - 1] << '\n', false;
}
