Company: Tavant_8_jan
Difficulty: medium
GPS For Autonomous Driving You are writing the navigation module for an autonomous car that is still in development, so it has one serious drawback: its steering may be used at most twice on a single trip . Any route it drives from the starting point to the finish point is therefore allowed to contain no more than two turns . The testing centre is a grid of b rows and p columns. Some cells hold road blockages and cannot be entered. The car moves one cell at a time, up, down, left or right, and never leaves the grid. A turn happens whenever the car moves in a direction different from the direction of its previous move. The very first move costs no turn, because the car may start off facing any of the four directions. Decide whether the car can get from the starting point to the finish point along a route that avoids every blockage and uses at most two turns. Input Format The first line contains the integer b , the number of rows. The second line contains the integer p , the number of co