#include using namespace std; using Int = long long; //INSERT ABOVE HERE signed main(){ Int h,w; cin>>h>>w; vector s(h); for(Int i=0;i>s[i]; auto check= [&](Int a,Int b){ if(!a&&!b) return; auto in=[&](Int y,Int x){return 0<=y&&y