#include<bits/stdc++.h> using namespace std; typedef long long ll; const int N = 60 + 10; char g[N][N]; bool vis[N][N]; int n, m, h; int dx[] = {1,-1,0,0}; int dy[] = {0,0,1,-1}; struct Node { int x,y,th,ans; }; int bfs() { queue<Node> q; q.push({0,0,h,0}); vis[0][0] = 1;...