#include <bits/stdc++.h>
using namespace std;
long long int a[100005], ind[100005], s[100005][10], dp[100005][130],
    hell = (-pow(10, 15));
bool comp(long long int i, long long int j) { return a[i] > a[j]; }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n, p, k;
  cin >> n >> p >> k;
  for (long long int i = 1; i <= n; i++) {
    cin >> a[i];
    ind[i] = i;
  }
  for (long long int i = 1; i <= n; i++)
    for (long long int j = 0; j < p; j++) cin >> s[i][j];
  sort(ind + 1, ind + n + 1, comp);
  for (long long int i = 0; i < 100005; i++)
    for (long long int j = 0; j < 130; j++) dp[i][j] = hell;
  dp[0][0] = 0;
  for (long long int i = 1; i <= n; i++)
    for (long long int j = 0; j < pow(2, p); j++) {
      long long int x = j, cnt = 0;
      if (i - (__builtin_popcount(j)) <= k)
        dp[i][j] = dp[i - 1][j] + a[ind[i]];
      else
        dp[i][j] = dp[i - 1][j];
      while (x > 0) {
        if (x & 1)
          dp[i][j] = max(dp[i][j], dp[i - 1][j ^ (1 << cnt)] + s[ind[i]][cnt]);
        x >>= 1;
        cnt++;
      }
    }
  cout << dp[n][(1 << p) - 1];
}
