Cijevi
To help design the new gas pipeline which will be used to deliver Russian gas to Croatia, Zagreb and Moscow are using the computer game Pipe Mania. In the game, Europe is divided into R rows and [] columns. Each cell can be empty or contain one of the seven basic pipeline building blocks:
• Period ('.'), representing an empty cell;
• The characters '|' (ASCII 124), '-', '+', '1', '2', '3', '4', representing the building block types;
• The letters 'M' and 'Z', representing Moscow and Zagreb.
Each of these will appear exactly once in the plan. The flow of gas will be uniquely determined in the input; exactly one building block will be adjacent to each of Moscow and Zagreb. Additionally, the plan will not have redundant blocks i.e. all blocks in the plan must be used after the missing block is added.
Input
[c]
3 7
.......
.M-.-Z.
.......
Output
2 4 -Submit solution
Coming laterThe grading service will be connected in a later migration step. You can inspect the task and your previous results now.