#include // std::string #include // std::cout #include #include using namespace std; int n; int m; vector a; int sol = 0; void Rec(int row, int col, int path) { if ((row == n || col == m)) { // solution if (path > sol) sol = path; return; } if (a[row][col] == '&') { // solution if (path > sol) sol = path; return; } // go down Rec(row + 1, col, path + 1); // go right Rec(row, col + 1, path + 1); } int main() { string tmp; getline(cin, tmp); stringstream ss(tmp); ss >> n; ss >> m; for(int i=0; i