#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const double eps = 1e-10;
const int mod = 1e9 + 7;
const int INF = 0x3f3f3f3f;
const int maxn = 1e5 + 5;
int n, p, k;
struct node {
  int a;
  int s[8];
  bool operator<(const node& ot) const { return a > ot.a; }
} buf[maxn];
long long ply[maxn][1 << 7], pre[maxn], aud[maxn][1 << 7];
int main(void) {
  scanf("%d%d%d", &n, &p, &k);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &buf[i].a);
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < p; j++) {
      scanf("%d", &buf[i].s[j]);
    }
  }
  sort(buf + 1, buf + n + 1);
  for (int i = 1; i <= n; i++) {
    pre[i] = pre[i - 1] + buf[i].a;
  }
  memset(ply, -1, sizeof(ply));
  memset(aud, -1, sizeof(aud));
  ply[0][0] = 0;
  aud[0][0] = pre[k];
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < (1 << p); j++) {
      int cnt = 0;
      for (int h = 0; h < p; h++) {
        if (j & (1 << h)) ++cnt;
      }
      for (int h = 0; h < p; h++) {
        if (!(j & (1 << h))) continue;
        if (ply[i - 1][j ^ (1 << h)] == -1) continue;
        long long _ply = ply[i - 1][j ^ (1 << h)] + buf[i].s[h], _aud;
        int num = i - cnt;
        if (num >= k)
          _aud = aud[i - 1][j ^ (1 << h)];
        else
          _aud = aud[i - 1][j ^ (1 << h)] - buf[i].a + buf[i + k - num].a;
        if (_aud + _ply > ply[i][j] + aud[i][j]) {
          ply[i][j] = _ply;
          aud[i][j] = _aud;
        }
      }
      long long _ply = ply[i - 1][j], _aud = aud[i - 1][j];
      if (_ply + _aud > ply[i][j] + aud[i][j]) {
        ply[i][j] = _ply;
        aud[i][j] = _aud;
      }
    }
  }
  printf("%lld\n", ply[n][(1 << p) - 1] + aud[n][(1 << p) - 1]);
  return 0;
}
