#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, p, k;
  scanf("%d %d %d", &n, &p, &k);
  vector<pair<int, int>> v(n + 1);
  for (int i = 1; i <= n; i++) {
    int a;
    scanf("%d", &a);
    v[i] = {a, i};
  }
  vector<vector<int>> s(n + 1, vector<int>(p + 1));
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= p; j++) scanf("%d", &s[i][j]);
  sort(v.begin() + 1, v.end());
  reverse(v.begin() + 1, v.end());
  vector<vector<long long>> dp(n + 1, vector<long long>(1 << p, -1e18));
  dp[0][0] = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < (1 << p); j++) {
      if (dp[i][j] < 0) continue;
      bitset<10> st(j);
      int has = i - (int)st.count();
      dp[i + 1][j] = max(dp[i + 1][j], dp[i][j]);
      if (has < k) dp[i + 1][j] = max(dp[i + 1][j], dp[i][j] + v[i + 1].first);
      for (int k = 0; k < p; k++) {
        if (st[k]) continue;
        dp[i + 1][j | (1 << k)] =
            max(dp[i + 1][j | (1 << k)], dp[i][j] + s[v[i + 1].second][k + 1]);
      }
    }
  }
  printf("%lld\n", dp[n][(1 << p) - 1]);
  return 0;
}
