#include <bits/stdc++.h>
using namespace std;
struct H {
  int x[8];
};
long long i, j, k, l, m, n, p, z[156], a[200040][156];
H w[200040];
int C(H a, H b) { return a.x[0] > b.x[0]; }
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> p >> k;
  for (m = 1 << p; i++ < n;) cin >> w[i].x[0];
  for (i = 0; i++ < n;) {
    for (j = 0; j++ < p;) cin >> w[i].x[j];
  }
  sort(w + 1, w + i, C);
  for (i = 0; ++i < m;) z[i] = z[i >> 1] + i % 2;
  for (i = 0; i++ < k;) a[0][0] += w[i].x[0];
  for (i = 0; i++ < n;) {
    a[i][0] = a[0][0];
    for (j = 0; ++j < m;) {
      a[i][j] = a[i - 1][j];
      if (i >= z[j]) {
        for (l = 0; l < p; l++) {
          if (j & 1 << l)
            a[i][j] = max(
                a[i][j], a[i - 1][j - (1 << l)] +
                             (i < k + z[j] ? w[k + z[j]].x[0] - w[i].x[0] : 0) +
                             w[i].x[l + 1]);
        }
      }
    }
  }
  cout << a[n][m - 1];
}
