#include <bits/stdc++.h>
using namespace std;
clock_t __START, __END;
double __TOTALTIME;
void _MS() { __START = clock(); }
void _ME() {
  __END = clock();
  __TOTALTIME = (double)(__END - __START) / CLOCKS_PER_SEC;
  cout << "Time: " << __TOTALTIME << " s" << endl;
}
const double E = 2.718281828;
const double PI = acos(-1.0);
const long long INF = (1LL << 60);
const int inf = (1 << 30);
const double ESP = 1e-9;
const int mod = (int)1e9 + 7;
const int N = (int)1e5 + 10;
struct node {
  int x;
  int v[10];
  friend bool operator<(node a, node b) { return a.x > b.x; }
} a[N];
long long dp[N][150];
int clac(int x) {
  int cnt = 0;
  while (x > 0) {
    if (x & 1) cnt++;
    x /= 2;
  }
  return cnt;
}
int main() {
  int n, p, k;
  scanf("%d%d%d", &n, &p, &k);
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i].x);
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= p; ++j) scanf("%d", &a[i].v[j]);
  sort(a + 1, a + 1 + n);
  int top = (1 << p) - 1;
  for (int i = 1; i <= n; ++i) {
    for (int j = 0; j <= top; ++j) {
      dp[i][j] = dp[i - 1][j];
      if (i - clac(j) <= k && clac(j) < i) dp[i][j] += a[i].x;
    }
    for (int j = 0; j <= top; ++j) {
      if (clac(j) >= i) continue;
      for (int pos = 1; pos <= p; ++pos) {
        if ((j & (1 << (pos - 1))) == 0) {
          dp[i][j | (1 << (pos - 1))] =
              max(dp[i][j | (1 << (pos - 1))], dp[i - 1][j] + a[i].v[pos]);
        }
      }
    }
  }
  printf("%lld\n", dp[n][top]);
  return 0;
}
