#include <bits/stdc++.h>
using namespace std;
class TaskE {
  long long n, p, k;
  vector<long long> a;
  vector<vector<long long>> s;
  long long countBits(long long v) {
    long long c = 0;
    while (v) {
      v &= (v - 1);
      c++;
    }
    return c;
  }

 public:
  TaskE(long long n, long long p, long long k) {
    this->n = n;
    this->p = p;
    this->k = k;
    a.resize(n);
    s.resize(n, vector<long long>(p));
    for (long long i = 0; i < n; i++) {
      cin >> a[i];
    }
    for (long long i = 0; i < n; i++) {
      for (long long j = 0; j < p; j++) {
        cin >> s[i][j];
      }
    }
  }
  long long solve() {
    vector<long long> idx(n, 0);
    iota(idx.begin(), idx.end(), 0);
    sort(idx.begin(), idx.end(),
         [&](long long i, long long j) { return a[i] > a[j]; });
    vector<long long> dp(1 << p, -1);
    dp[0] = 0;
    for (long long i = 0; i < n; i++) {
      vector<long long> ndp(1 << p, -1);
      for (long long mask = 0; mask < (1 << p); mask++) {
        if (i - countBits(mask) < k) {
          if (dp[mask] != -1) {
            ndp[mask] = dp[mask] + a[idx[i]];
          }
        } else {
          if (dp[mask] != -1) {
            ndp[mask] = dp[mask];
          }
        }
        for (long long j = 0; j < p; j++) {
          if ((mask & (1 << j)) and (dp[mask ^ (1 << j)] != -1)) {
            ndp[mask] = max(ndp[mask], dp[mask ^ (1 << j)] + s[idx[i]][j]);
          }
        }
      }
      dp = ndp;
    }
    return dp[(1 << p) - 1];
  }
};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, p, k;
  cin >> n >> p >> k;
  TaskE E(n, p, k);
  cout << E.solve();
}
