#include <bits/stdc++.h>
using namespace std;
long long n, p, k;
pair<long long, long long> a[100009];
long long s[100009][8];
long long dp[100002][130];
long long go(long long x, long long bl) {
  if (x < 0) return 0;
  long long y = a[x].second;
  if (dp[y][bl] != -1) return dp[y][bl];
  int u = 0;
  for (int i = 0; i < p; i++)
    if (!(bl & (1 << i)))
      dp[y][bl] = max(dp[y][bl], s[y][i] + go(x - 1, (bl | (1 << i))));
    else
      u++;
  if (n - 1 - x - u < k)
    dp[y][bl] = max(dp[y][bl], a[x].first + go(x - 1, bl));
  else if (u <= p)
    dp[y][bl] = max(dp[y][bl], go(x - 1, bl));
  return dp[y][bl];
}
int main() {
  ios::sync_with_stdio(0);
  scanf("%I64d%I64d%I64d", &n, &p, &k);
  memset(dp, -1, sizeof dp);
  for (int i = 0; i < n; i++) {
    scanf("%I64d", &a[i].first);
    a[i].second = i;
  }
  sort(a, a + n);
  for (int i = 0; i < n; i++)
    for (int j = 0; j < p; j++) scanf("%I64d", &s[i][j]);
  printf("%I64d", go(n - 1, 0));
  return 0;
}
