void main(){ import std.stdio, std.string, std.conv, std.algorithm; int h, w, t; rd(h, w, t); int sy, sx; rd(sy, sx); int gy, gx; rd(gy, gx); auto c=new char[][](h, w); foreach(i; 0..h) c[i]=readln.chomp.to!(char[]); const double eps=1e-9; const int[][] dir=[[1, 0], [-1, 0], [0, 1], [0, -1]]; auto dp=new double[][](h, w); foreach(i; 0..h) fill(dp[i], 0.0); dp[sy][sx]=1.0; foreach(_; 0..min(t, 1_000_00+t%2)){ auto nex=new double[][](h, w); foreach(i; 0..h) fill(nex[i], 0.0); foreach(i; 0..h)foreach(j; 0..w){ if(c[i][j]=='#') continue; if(dp[i][j]