#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <memory.h>
#include <math.h>
#include <assert.h>
#include <queue>
#include <map>
#include <set>
#include <string>
#include <algorithm>
#include <iostream>
#include <functional>
#include <unordered_map>
#include <list>

using namespace std;
typedef pair<int, int> Pi;
typedef long long ll;
#define Fi first
#define Se second
#define pb(x) push_back(x)
#define sz(x) (int)x.size()
#define rep(i, n) for(int i=0;i<n;i++)
#define all(x) x.begin(), x.end()

int N, M;
ll A[5050], B[5050][210];

typedef pair<ll, int> PL;
ll T[5050][5050];

void solve(){
	scanf("%d%d", &N, &M);
	for(int i=2;i<=N;i++)scanf("%lld", A+i), A[i] += A[i-1];
	for(int i=1;i<=N;i++){
		for(int j=1;j<=M;j++)scanf("%lld", B[i]+j);
	}
	for(int i=1;i<=M;i++){
		vector <PL> v;
		for(int j=1;j<=N;j++)v.pb(PL(B[j][i], j));
		sort(all(v)); reverse(all(v));
		set <int> S;
		S.insert(0); S.insert(N+1);
		for(PL e : v){
			auto it = S.lower_bound(e.Se);
			int R = *it;
			int L = *(--it);
			int x = e.Se;
			T[x][L+1] += e.Fi;
			T[R][L+1] -= e.Fi;
			T[x][x+1] -= e.Fi;
			T[R][x+1] += e.Fi;
			S.insert(e.Se);
		}
	}
	ll ans = 0;
	for(int i=1;i<=N;i++){
		for(int j=1;j<=N;j++){
			T[i][j] += T[i-1][j] + T[i][j-1] - T[i-1][j-1];
			if(j <= i)ans = max(ans, T[i][j] - A[i] + A[j]);
		}
	}
	printf("%lld", ans);
}

int main(){
	int Tc = 1;// scanf("%d", &Tc);
	for(int tc=1;tc<=Tc;tc++){
		solve();
	}
	return 0;
}