#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
const int maxn = 1e5 + 12, lg = 129;
const long long int inf = 1e18;
int a[maxn], s[maxn][7], B[maxn];
long long int dp[maxn][lg];
int n, P, k, msk;
bool cmp(int i, int j) { return a[i] > a[j]; }
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n >> P >> k;
  msk = (1 << P);
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    B[i] = i;
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < P; j++) {
      cin >> s[i][j];
    }
  }
  sort(B + 1, B + n + 1, cmp);
  for (int i = 0; i <= n; i++) {
    for (int j = 0; j < msk; j++) {
      dp[i][j] = -inf;
    }
  }
  dp[0][0] = 0;
  for (int i = 1; i <= n; i++) {
    for (int mask = 0; mask < msk; mask++) {
      dp[i][mask] = dp[i - 1][mask];
      auto x = i - __builtin_popcount(mask);
      if (x <= k) {
        dp[i][mask] += a[B[i]];
      }
      for (int j = 0; j < P; j++) {
        if ((mask >> j) % 2) {
          long long int X = dp[i - 1][mask ^ (1 << j)] + s[B[i]][j];
          dp[i][mask] = max(dp[i][mask], X);
        }
      }
    }
  }
  cout << dp[n][msk - 1];
}
