#include using namespace std; #define ll long long int #define DO long double #define pb push_back #define gc getchar_unlocked #define fi first #define se second #define pii pair #define pll pair #define mp make_pair #define vi vector #define vll vector const int mod = (int)1e9+7,mx=(int)1e6+1; pii ne[4]={mp(0,1), mp(1,0), mp(-1,0), mp(0,-1)}; char gr[50][50]; DO dp[50][50]; bool vis[50][50]; struct tunnel{ int y1,x1,y2,x2; }; tunnel arr[50]; int n; int m; int k; DO dfs(int y, int x){ if(dp[y][x]!=-1) return dp[y][x]; if(vis[y][x]) return 0; vis[y][x]=1; int it,i,j,t=0, cntn=0; DO ret=0; for(it=0;it<4; it++){ i = y + ne[it].fi; j = x + ne[it].se; if(0<=i && i> n >> m >> k; for(int a0 = 0; a0 < n; a0++){ string row; cin >> row; // Write Your Code Here for(j = 0; j> i1 >> j1 >> i2 >> j2; arr[a0] = {i1,j1,i2,j2}; } for(i=0; i