ll@H,@W,D=100,M=3D,A[M][M]{},x=0;rep(i,H)rep(j,W){ll@a;A[D+i][D+j]=a;} rep(i,M)rep(j,i+1,M)x>?=sum[k,0,M](A[i][k]+A[j][k]),x>?=sum[k,0,M](A[k][i]+A[k][j]); rep(i,-M,M)rep(j,i+1,M)x>?=sum[k,0,M@0<=i+k?=sum[k,0,M@0<=i-k?=sum[k,0,M](A[i][k])+sum[k,0,M](A[k][j])-A[i][j], x>?=sum[k,0,M](A[i][k])+sum[k,-M,M@0<=i+k?=sum[k,0,M](A[i][k])+sum[k,-M,M@0<=i+k?=sum[k,0,M](A[k][j])+sum[k,-M,M@0<=i+k?=sum[k,0,M](A[k][j])+sum[k,-M,M@0<=i+k?=sum[k,-M,M@0<=i+k