CodeChef's submission of Paper Cube | CodeChef