You are to write a program that will read the paths of the input maze then finds the shortest path from the entrance to
the exit of the maze.
Input Format
The first line in the input file is a positive integer that contains the number of mazes. A maze contains several symbols,
namely: "+ - |" denotes walls; empty spaces are pathways; "*" is a point in the path; and entrance is represented by "E"
and the exit is represented by "X". Each maze is separated by an empty line.
Output Format
You are to mark the points in the shortest path by the sequence number of the path.
Sample Input (input.in)
2
E
+ +-+-+-+-+
|* *|* * *|
+-+ + + +-+
|*|*|*|* *|
+ + +-+-+ +
|*|* * * *|
+ +-+-+-+ +
|* * *|* *|
+ +-+-+ +-+
|* * * * *|
+-+-+-+-+ +
X
E
+ +-+-+-+-+
|* * *|* *|
+-+-+ + + +
|* * *|*|*|
+ +-+-+ + +
|* *|*|*|*|
+-+ + + + +
|*|*|* *|*|
+ + +-+-+ +
|* * * * *|
+-+-+-+-+ +
X
CCS Computing Laboratories
Sample Output
E
+ +-+-+-+-+
|0 1|* * *|
+-+ + + +-+
|*|2|*|* *|
+ + +-+-+ +
|*|3 4 5 6|
+ +-+-+-+ +
|* * *|8 7|
+ +-+-+ +-+
|* * * 9 0|
+-+-+-+-+ +
X
E
+ +-+-+-+-+
|0 1 2|* *|
+-+-+ + + +
|5 4 3|*|*|
+ +-+-+ + +
|6 7|*|*|*|
+-+ + + + +
|*|8|* *|*|
+ + +-+-+ +
|* 9 0 1 2|
+-+-+-+-+ +
X