segment walls in the maze. One cannot cross the walls but can touch them or walk along them. Now a MI robot is assigned to go from. ), as an intelligent robot, MI robot will automatically determine the shortest valid path and go along it. Print the length of the shortest valid path between
Given a maze of size ntimes m n×m, whose lower-left corner is (0, 0)_{} (0,0) while upper-right corner is (n, m)_{} (n,m) . And there are k_{} k segment walls in the maze. One cannot cross the walls but can touch them or walk along them. Now a MI robot is assigned to go from (X_1, Y_1) (X 1 ,Y 1 ) to (X_2, Y_2) (X 2 ,Y 2 ), as an intelligent robot, MI robot will automatically determine the shortest valid path and go along it. Print the length of the shortest valid path between (X_1, Y_1) (X 1 ,Y 1 ) and (X_2, Y_2) (X 2 ,Y 2 ).