Problem L. Visual Cube

HDU - 6330