#include #include #include #include #include #define ll long long #define mst(a,x) memset(a,x,sizeof(a)) using namespace std; int n, m, k; const int N = 55; const int INF = 1e9 + 5; const int dx[4] = {-1, 1, 0, 0}; const int dy[4] = {0, 0, -1, 1}; int x1, Y1, x2, y2; double dp[N][N][N], ans; char a[N][N]; bool inmap(int x, int y) { return x >= 0 && x < n && y >= 0 && y < m; } int main() { int T, x, y; scanf("%d", &T); while(T--) { scanf("%d%d%d", &n, &m, &k); for(int i = 0; i < n; i++) scanf("%s", a[i]); scanf("%d%d%d%d", &x1, &Y1, &x2, &y2); x1--; Y1--; x2--; y2--; if(!k) { puts("No Answer"); continue; } if(x1 == x2 && Y1 == y2) { puts("0.00"); continue; } for(int i = 0; i < n; i++) for(int j = 0; j < m; j++) dp[0][i][j] = INF; dp[0][x1][Y1] = 0; ans = INF; for(int t = 1; t < k; t++) for(int i = 0; i < n; i++) for(int j = 0; j < m; j++) { dp[t][i][j] = INF; for(int p = 0; p < 4; p++) { x = i + dx[p]; y = j + dy[p]; if(!inmap(x, y) || a[x][y] == '#' || a[i][j] == '#') continue; dp[t][i][j] = min(dp[t][i][j], dp[t - 1][x][y] + fabs(1.0*(a[i][j] - a[x][y])) / (k - t + 1)); } if(i == x2 && j == y2) ans = min(ans, dp[t][i][j]); } if(ans > 1e9) puts("No Answer"); else printf("%.2lf\n", ans); } return 0; }