#include <bits/stdc++.h>
using namespace std;
const int NN = 1e6 + 7;
const int N = 1e5 + 7;
const int M = 10;
const int mod = 1e9 + 7;
const long long inf = 1e18 + 7;
int n, p, k;
long long s[N][M];
long long d[N][(1 << 7)];
pair<long long, int> a[N];
void solve1() {
  cin >> n >> p >> k;
  for (int i = 1; i <= n; i++) {
    cin >> a[i].first;
    a[i].second = i;
  }
  sort(a + 1, a + n + 1);
  reverse(a + 1, a + n + 1);
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < p; j++) {
      cin >> s[i][j];
    }
  }
  for (int i = 0; i <= n; i++) {
    for (int j = 0; j < (1 << p); j++) {
      d[i][j] = -inf;
    }
  }
  d[0][0] = 0;
  for (int f = 1; f <= n; f++) {
    int i = a[f].second;
    for (int j = 0; j < (1 << p); j++) {
      d[f][j] = d[f - 1][j];
      int y = __builtin_popcount(j);
      if (f - 1 - y < k) d[f][j] += a[f].first;
      for (int h = 0; h < p; h++) {
        if (!(j & (1 << h))) continue;
        d[f][j] = max(d[f][j], d[f - 1][(j ^ (1 << h))] + s[i][h]);
      }
    }
  }
  cout << d[n][(1 << p) - 1];
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  srand(time(0));
  int cghf = 1;
  while (cghf--) {
    solve1();
  }
}
