#include <bits/stdc++.h>
#pragma optimize GCC("O3")
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  const long long minf = -1000000000000000079;
  long long n, p, k;
  cin >> n >> p >> k;
  vector<vector<long long> > pl(n, vector<long long>(p + 1));
  for (int i = 0; i < n; i++) cin >> pl[i][0];
  for (int i = 0; i < n; i++)
    for (int j = 1; j <= p; j++) cin >> pl[i][j];
  sort(pl.begin(), pl.end());
  reverse(pl.begin(), pl.end());
  vector<vector<long long> > dp(n + 1, vector<long long>(1 << p, minf));
  dp[0][0] = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < (1 << p); j++) {
      int cnt = 0;
      for (int pi = 0; pi < p; pi++)
        if (j & (1 << pi)) cnt++;
      if (cnt + k >= i) {
        dp[i][j] = max(dp[i - 1][j] + pl[i - 1][0], dp[i][j]);
      } else {
        dp[i][j] = max(dp[i - 1][j], dp[i][j]);
      }
      for (int pi = 0; pi < p; pi++)
        if (j & (1 << pi)) {
          dp[i][j] =
              max(dp[i - 1][j ^ (1 << pi)] + pl[i - 1][pi + 1], dp[i][j]);
        }
    }
  }
  cout << dp[n][(1 << p) - 1] << endl;
  return 0;
}
