#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define X first #define Y second #define pb push_back #define rep(X,Y) for (int (X) = 0;(X) < (Y);++(X)) #define rrep(X,Y) for (int (X) = (Y)-1;(X) >=0;--(X)) #define repe(X,Y) for ((X) = 0;(X) < (Y);++(X)) #define peat(X,Y) for (;(X) < (Y);++(X)) #define all(X) (X).begin(),(X).end() #define rall(X) (X).rbegin(),(X).rend() #define eb emplace_back #define UNIQUE(X) (X).erase(unique(all(X)),(X).end()) using namespace std; typedef long long ll; typedef pair pii; typedef pair pll; template using vv=vector>; template ostream& operator<<(ostream &os, const vector &t) { os<<"{"; rep(i,t.size()) {os< ostream& operator<<(ostream &os, const pair &t) { return os<<"("< typedef pair piii; int main(){ ios_base::sync_with_stdio(false); cout<>n>>m>>a>>sy>>sx>>b>>gy>>gx; vector mp(n); rep(i,n) cin>>mp[i]; if((sy+sx-gy-gx+a-b)%2){ //assert(0); cout<<"No"< que; que.emplace(pii(sx,sy),a); while(que.size()){ piii p=que.front(); que.pop(); int t=p.Y; //if(p.X==gx && p.Y==gy && t>=b) break; rep(d,4){ int x=p.X.X+dx[d],y=p.X.Y+dy[d]; if(x<0 || m<=x || y<0 || n<=y) continue; int tt=t-1; if(mp[y][x]=='*') tt+=2; if(tt<=0 || 3000