ll@(h,w,sx--,sy--); string@s[h]; ll ae[h][w]{},ao[h][w]{}; queue,ll>>v; v.push({{sx,sy},0}); while(!v.empty()){ auto a=v.front(); v.pop(); ll tx,ty,tn; tx=a.first.first; ty=a.first.second; tn=a.second+1; rep(dx,-1,2){ rep(dy,-1,2){ if(dx||dy){ for(ll x=tx,y=ty;x+=dx,y+=dy,x>=0&&x=0&&y