Saved Bookmarks
| 1. |
You have hospital with MXN number of rooms. Suddenly bacterial infection occurs in one room and its starts spreading in North, South, West, East direction and only to its adjacent room which is opened. Find how long would it take for the bacteria to be spread to the entire hospital.Input Format:First line contains two integers, M, N, space separated, giving the size of the hospital in terms of the number ofrows and columns respectivelyThe next M lines, where the line containing N characters each of which is either o or room. giving the status of theThe next line contains two integers X,Y, space separated, giving the ordinates of the first room that curd bacteria. |
|
Answer» what is the answer.please TELL |
|