The input is a two-dimensional maze with walls, and the problem is to traverse the maze, using the shortest route, from the upper lefthand corner to the lower right-hand corner. You may knock down walls, but each wall you knock down incurs a penalty $p$ (that is specified as part of the input).