Curling up the cube |
A paper cube can be made up from six paper squares Given an projection (map) of the cube, you are to determine its correctness. A projection is correct, if a cube can be made up from it.
Input contains a projection represented as a 6*6 grid containing six ones and 30 zeroes, separated by spaces. 1s represent the paper squares. All squares are placed immediately to each other, so that each square is connected with at least one other square.
Your program should print "correct" if cube can be made up from the given project, or "incorrect" otherwise.
0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 1 1 1 0 0 0 0 1 0 0 0 0 0 0 0 0
correct
0 0 0 0 0 0 0 0 0 1 1 0 0 0 1 1 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0
incorrect