The HTML version of the statement is not available.
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!