CF1063B Labyrinth
Description
You are playing some computer game. One of its levels puts you in a maze consisting of $ n $ lines, each of which contains $ m $ cells. Each cell either is free or is occupied by an obstacle. The starting cell is in the row $ r $ and column $ c $ . In one step you can move one square up, left, down or right, if the target cell is not occupied by an obstacle. You can't move beyond the boundaries of the labyrinth.
Unfortunately, your keyboard is about to break, so you can move left no more than $ x $ times and move right no more than $ y $ times. There are no restrictions on the number of moves up and down since the keys used to move up and down are in perfect condition.
Now you would like to determine for each cell whether there exists a sequence of moves that will put you from the starting cell to this particular one. How many cells of the board have this property?
Input Format
N/A
Output Format
N/A
Explanation/Hint
Cells, reachable in the corresponding example, are marked with '+'.
First example:
```
+++..
+***.
+++**
*+++.
```
Second example:
```
.++.
.+*.
.++.
.++.
```