#include using namespace std; typedef signed long long ll; #undef _P #define _P(...) (void)printf(__VA_ARGS__) #define FOR(x,to) for(x=0;x>H>>W; FOR(y,H) cin>>S[y]; ll ret=mo-perf(); FOR(i,2) { ret += pat(); FOR(x,W) FOR(y,H) T[x]+=S[y][x]; FOR(x,W) S[x]=T[x]; swap(H,W); } cout<