Editorial for COCI '08 Contest 6 #3 Nered
Remember to use this editorial only when stuck, and not to copy-paste code from it. Please be respectful to the problem author and editorialist.
Submitting an official solution before solving the problem yourself is a bannable offence.
Submitting an official solution before solving the problem yourself is a bannable offence.
Cubes that are on top of other cubes will surely need to be moved so we can add them to our output immediately. Now we need to find the rectangle that contains the most cubes, with an area equal to the total number of cubes. This rectangle can be found by considering all possible rectangles.
Comments