#define _USE_MATH_DEFINES #include #define int long long #define rep(i,n) for(int i=0;i=0;i--) #define vi vector #define pb push_back #define pi pair #define vp vector> #define mp make_pair #define all(v) (v).begin(),(v).end() #define fi first #define se second #define MEMSET(a) memset(a,0,sizeof(a)) #define inf (1ll<<60) #define Yes(f) cout<<(f?"Yes":"No")<>n>>m; vector a(m,vi(n+1)); rep(i,m){ REP(j,1,n){ cin>>a[i][j]; if(i)a[i][j]+=a[i-1][j]; } } rep(i,m){ REP(j,1,n){ a[i][j]+=a[i][j-1]; } } rep(i,m){ for(int l=1,r=1;l