#include<bits/stdc++.h>
#define ll long long 
using namespace std;
const int N=5e3+10;
const int M=220;
ll a[N],b[N][M],cnt[N][N];
int n,m,S[N],top,L[N][M],R[N][M];
inline int rd(){
	int x=0;int f=1;char s=getchar();
	while(!isdigit(s)){if(s=='-')f=-1;s=getchar();}
	while(isdigit(s)) x=(x<<1)+(x<<3)+s-'0',s=getchar();
	return x*f;
}
int main(){
	n=rd();m=rd();a[0]=a[1]=0;
	for(int i=2;i<=n;i++) a[i]=a[i-1]+1ll*rd();
	for(int i=1;i<=n;i++)
		for(int j=1;j<=m;j++) b[i][j]=1ll*rd();
	for(int j=1;j<=m;j++){
		top=0;
		for(int i=1;i<=n;i++){
			while(top && b[S[top]][j] <b[i][j] ) top--;
			L[i][j]=top?S[top]+1:1;
			S[++top]=i;
		}
		top=0;
		for(int i=n;i>=1;i--){
			while(top && b[S[top]][j]<b[i][j] ) top--;
			R[i][j]=top?S[top]-1:n;
			S[++top]=i;
		}
		for(int i=1;i<=n;i++){
			cnt[L[i][j]][i]+=b[i][j];
			cnt[L[i][j]][R[i][j]+1]-=b[i][j];
			cnt[i+1][i]-=b[i][j];
			cnt[i+1][R[i][j]+1]+=b[i][j];
		}
	}	
	ll ans=0;
	for(int i=1;i<=n;i++){
		
		for(int j=1;j<=n;j++) cnt[i][j]+=cnt[i][j-1];
		for(int j=1;j<=n;j++) cnt[i][j]+=cnt[i-1][j];
		for(int j=i;j<=n;j++) ans=max(ans,cnt[i][j]-a[j]+a[i]); 
	} 
	printf("%lld\n",ans); 
	return 0;
}