#pragma GCC optimize("Ofast") #pragma GCC target("avx2") char*mmap(); #define rd(v) long v=0;{long _c;while(_c=*rp++-48,_c>=0)v=v*10+_c;} #define wt(v) {long _z=v;do*--wp=_z%10+48;while(_z/=10);} #define rep(v,e) for(long v=0;v>8|a[i]<<24; } } void radix_sort(unsigned*a,int n){ radix_sort_aux(a,a+n,n); radix_sort_aux(a+n,a,n); radix_sort_aux(a,a+n,n); radix_sort_aux(a+n,a,n); } int a[300][300]; int b[300]; int d[600]; main(){ char*rp=mmap(0l,1l<<25,1,2,0,0ll); rd(n); rd(m); rep(i,n){ rep(j,m){ rd(aij); a[i][j]=aij; b[j]+=aij; } } rep(i,n){ rep(j,m){ d[i]+=b[j]*a[i][j]; } } radix_sort(d,n); long z=0; rep(i,n){ z=d[i]-z; } char wbuf[64],*wp=wbuf+sizeof wbuf; wt(z); write(1,wp,wbuf+sizeof wbuf-wp); _exit(0); }