Everyone knows that in order to quickly get out of the maze, you need to find the shortest path. The game Maze Zero has the same problem, but it needs to be solved in a purely mathematical way using elementary calculations. The output is visible, it is indicated by the number zero. Your block also has some numerical value. Blocks with minus values are placed in the corridors of the labyrinth. You must reach the exit and completely reset, but not earlier and not later than you get to the cell with a zero mark. Calculate the moves in the literal sense and move, everything is simple in Maze Zero.