#include #include #include using namespace std; int main() { int a,b; cin>>a>>b; char mat[a][b]; bool v[a][b]; for(int i=0;i>mat[i][j]; v[i][j]=false; } } int k=0; for(int i=0;iQ; Q.push(i); Q.push(j); while(!Q.empty()) { int ci=Q.front(); Q.pop(); int cj=Q.front(); Q.pop(); if(ci+1=0 && mat[ci-1][cj]!='-' && v[ci-1][cj]==false) { Q.push(ci-1); Q.push(cj); v[ci-1][cj]=true; } if(cj+1=0 && mat[ci][cj-1]!='-' && v[ci][cj-1]==false) { Q.push(ci); Q.push(cj-1); v[ci][cj-1]=true; } } k++; } } } cout<