#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
const long long inf = 0x3f3f3f3f3f3f3f3f;
long long dp[maxn][1 << 8];
struct node {
  int a, id;
  bool operator<(const node &rhs) const {
    if (a == rhs.a) return id < rhs.id;
    return a > rhs.a;
  }
} a[maxn];
int f[maxn][10];
inline int bitcount(int x) {
  int res = 0;
  while (x) {
    if (x & 1) res++;
    x >>= 1;
  }
  return res;
}
int main(void) {
  int n, p, k;
  scanf("%d%d%d", &n, &p, &k);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i].a);
    a[i].id = i;
  }
  sort(a + 1, a + 1 + n);
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= p; j++) {
      scanf("%d", &f[i][j]);
    }
  }
  int ts = 1 << p;
  memset(dp, -1, sizeof(dp));
  dp[0][0] = 0;
  for (int i = 1; i <= n; i++) {
    int j = a[i].id;
    for (int s = 0; s < ts; s++) {
      int bit = bitcount(s);
      int in = i - 1 - bit;
      if (in < k && dp[i - 1][s] != -1)
        dp[i][s] = dp[i - 1][s] + a[i].a;
      else
        dp[i][s] = dp[i - 1][s];
      for (int k = 1; k <= p; k++) {
        if (((s >> (k - 1)) & 1) && dp[i - 1][s ^ (1 << (k - 1))] != -1) {
          dp[i][s] = max(dp[i][s], dp[i - 1][s ^ (1 << (k - 1))] + f[j][k]);
        }
      }
    }
  }
  printf("%I64d\n", dp[n][ts - 1]);
  return 0;
}
