IOI '97 - Cape Town, South Africa
"iShongololo" is the Zulu name for a millipede. They are long, shiny, black arthropods with many legs.

The iShongololo eats through an edible "fruit" which for the sake of
this problem can be considered a rectangular solid with integer
dimensions of
You are required to write a program that maximizes the number of blocks eaten by the iShongololo without violating the constraints given. The program must output the actions that the iShongololo makes as it eats its way through the fruit.
The iShongololo starts outside the fruit. The first block the
iShongololo must eat is
Constraints:
- The iShongololo occupies exactly one empty block.
- The iShongololo can only eat one complete block at a time.
- The iShongololo cannot move to a position where it has previously moved to (that is, move backwards or cross its path).
- The iShongololo cannot move to a solid (uneaten) block, or outside the fruit.
- The iShongololo may only move to or eat blocks with whom it shares a face. It may only eat blocks which have no other faces exposed to empty eaten blocks.
Input Specification
As input your program will receive three numbers (integers) which are
the length
The three integers
Output Specification
The output consists of lines that begin with E
(eat) or M
(move)
followed by
Sample Input
Input | Explanation |
Copy
|
Copy
|
Sample Output
Output | Explanation |
Copy
|
Copy
|
Scoring
- If the iShongololo violates the constraints, then your solution
receives
points. - The total score is the percentage of blocks eaten as a proportion to an excellent solution of the IOI organizers, rounded to the nearest integer percent.
- A solution cannot score more than
.
Comments