Time Limit: 1000 ms
Memory Limit: 65535 ms
In this problem you have to solve a very simple maze consisting of:
A maze may look like this:
You have to find a shortest path between the square with the start marker and the square with the end marker. Only moves between adjacent grid squares are allowed; adjacent means that the grid squares share an edge and are not separated by a wall. It is not allowed to leave the grid.