#include <bits/stdc++.h>
using namespace std;
long long n, p, k, s[100005][10];
pair<long long, int> dp[100005][130], a[100005];
bool cmp(pair<long long, int> a, pair<long long, int> b) {
  return a.first > b.first;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
  cin >> n >> p >> k;
  for (int i = 1; i <= n; i++) {
    cin >> a[i].first;
    a[i].second = i;
  }
  sort(a + 1, a + 1 + n, cmp);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= p; j++) cin >> s[i][j];
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < (1 << p); j++) {
      int cnt = __builtin_popcount(j);
      for (int t = 0; t < p; t++)
        if ((j >> t) & 1 == 1) {
          if (dp[i - 1][j - (1 << t)].first + s[a[i].second][t + 1] >
              dp[i][j].first) {
            dp[i][j].first =
                dp[i - 1][j - (1 << t)].first + s[a[i].second][t + 1];
            dp[i][j].second = dp[i - 1][j - (1 << t)].second;
          }
        }
      if (cnt < i) {
        if (i > cnt + k)
          dp[i][j].first = max(dp[i - 1][j].first, dp[i][j].first);
        else
          dp[i][j].first = max(dp[i - 1][j].first + a[i].first, dp[i][j].first);
      }
    }
  }
  cout << dp[n][(1 << p) - 1].first;
}
