#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const int N = 1e5 + 10, M = 1 << 7;
struct node {
  int id, val;
} a[N];
int w[N][10];
long long dp[N][M];
int cmp(node a, node b) { return a.val > b.val; }
int count(int x) {
  int cnt = 0;
  while (x) {
    if (x & 1) cnt++;
    x >>= 1;
  }
  return cnt;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int n, p, k;
  cin >> n >> p >> k;
  for (int i = 1; i <= n; i++) {
    cin >> a[i].val;
    a[i].id = i;
  }
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= p; j++) cin >> w[i][j];
  sort(a + 1, a + 1 + n, cmp);
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < 1 << p; j++) {
      dp[i][j] = dp[i - 1][j];
      int cnt = count(j);
      if (cnt < i && i - cnt <= k) dp[i][j] = dp[i - 1][j] + a[i].val;
      for (int s = 1; s <= p; s++)
        if (1 << (s - 1) & j)
          dp[i][j] =
              max(dp[i][j], dp[i - 1][j ^ (1 << (s - 1))] + w[a[i].id][s]);
    }
  }
  cout << dp[n][(1 << p) - 1] << endl;
  return 0;
}
