#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; const double pi=4*atan(1.0); constexpr long long mod=static_cast(1e9+7); using cWeightEdges=vector>>; using cEdges=vector>; int main() { int h,w; cin>>h>>w; int Sx,Sy,Gx,Gy; cin>>Sx>>Sy>>Gx>>Gy; --Sx,--Sy,--Gx,--Gy; vector> Height(h,vector(w,0)); for(auto& val:Height){ string str; cin>>str; for(int i=0;i> memo(h,vector(w,0)); queue> Q; Q.push(make_pair(Sx,Sy)); memo[Sx][Sy]=true; bool IsFind=false; while(!Q.empty()){ auto now=Q.front(); Q.pop(); if(now.first==Gx && now.second==Gy){ IsFind=true; break; } if(now.first+1