Color Cubes Advanced
It is recommended to solve Color Cubes at first to get the understanding of the game rules.
Here is the same game of Color Cubes, but the field is larger. You (and other contestants) are given some initial setup of the blocks and the goal is to find the sequence of moves leading to the highest score.
Input data are the same for all contestants.
They will contain the size of the box
N in the first line (somewhere between
N lines contain
N digits each (from
4) describing colors of the squares.
Answer should contain pairs of coordinates for moves separated only with spaces i.e.
X0 Y0 X1 Y1 X2 Y2 .... Note
0 0 is at the bottom left corner!
You may use this test page to visualize the work of your solution.
Scoring There is some reasonable limit of points below which your answer is not accepted. If your score is above this limit the result is calculated as
result = score / limit - 1
(and then multiplied by the challenge coefficient)