The size of the map given as maximum rows and columns.
Several positions in the map, each of them with only one of the following elements:
Empty - represented as ’_’, by default all map is empty.
Player - represented as ’p’, it has to be only one.
Material - represented as ’m’
Enemy - represented as ’e’
A dot, this will help to delimitate map setup from movements.
A sequence of movements given as a pair (± 1, ± 1), indicating the rows and columns to advance each round.
The player can only walk one position at a time in any direction.
If the player walks into a material position, it will be collected, when all materials are collected the game ends.
If the player walks into an enemy position, it will die and the game ends.
Output
About statements
The official statement of a problem is always the one
in the PDF document. The HTML version of the statement
is also given to help you, but may contain some content
that is not well displayed. In case of doubt, always use the PDF.
Public test cases
Input
3 3
0 1 p
1 1 e
1 2 m
2 0 e
.
1 1
Output
Initial state
_ p _
_ e m
e _ _
Materials collected 0/1
_ _ _
_ e p
e _ _
Materials collected 1/1
You have collected all the materials! Congratulations!
Input
3 3
0 1 p
1 1 e
1 2 m
2 0 e
.
1 1
Output
Initial state
_ p _
_ e m
e _ _
Materials collected 0/1
_ _ _
_ e p
e _ _
Materials collected 1/1
You have collected all the materials! Congratulations!