#include <bits/stdc++.h>
using namespace std;
const int N = 100009;
int n, p, k, Max;
long long f[N][130];
struct Node {
  int A, b[10];
  bool operator<(const Node &B) const { return A > B.A; }
} a[N];
void init() {
  scanf("%d %d %d", &n, &p, &k);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i].A);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= p; j++) scanf("%d", &a[i].b[j]);
  sort(a + 1, a + 1 + n);
  Max = 1 << p;
}
void work() {
  for (int j = 1; j < Max; j++) f[0][j] = -1;
  for (int i = 1; i <= n; i++)
    for (int j = 0; j < Max; j++) {
      int tmp = 0;
      f[i][j] = f[i - 1][j];
      for (int l = 1; l <= p; l++)
        if (j & (1 << l - 1)) {
          tmp++;
          if (f[i - 1][j ^ (1 << l - 1)] != -1)
            f[i][j] = max(f[i][j], f[i - 1][j ^ (1 << l - 1)] + a[i].b[l]);
        }
      if (i - tmp <= k && f[i - 1][j] != -1)
        f[i][j] = max(a[i].A + f[i - 1][j], f[i][j]);
    }
  printf("%lld\n", f[n][Max - 1]);
}
int main() {
  init();
  work();
  return 0;
}
