Problem B
Espresso Bucks
-
Each land cell must have a coffee shop directly on it, or adjacent to it.
-
No two coffee shops can be adjacent to each other.
Two cells are adjacent if one is immediately to the west, north, east, or south of the other. Find any placement of coffee shops that satisfies these constraints.
Input
The first line of input consists of two integers $n$ and $m$ ($1 \leq n,m \leq 100$). The following $n$ lines each contain a string of length $m$ consisting only of the characters ‘.’ (land) and ‘#’ (water). This is the map of gridland. It is guaranteed that the map contains at least one land cell.
Output
Output a copy of the map of gridland, where some of the land cells have been replaced with the letter ‘E’, meaning that a coffee shop was placed on the corresponding land cell. This placement should satisfy the constraints above. If there are many solutions, any one will be accepted.
Sample Input 1 | Sample Output 1 |
---|---|
5 6 ....#. ....#. #..... ...... ##...# |
E..E#. ..E.#E #..E.. .E...E ##E.E# |
Sample Input 2 | Sample Output 2 |
---|---|
10 16 ########.#....## ######......#### #####.....###### ###.......###### ##.......####### ##.........##### ##......######## ##....########## ###.############ ##...########### |
########E#.E.E## ######E...E.#### #####E.E.E###### ###E..E.E.###### ##E..E.E.####### ##.E..E..E.##### ##E..E.E######## ##.E..########## ###.############ ##E.E########### |