Editorial for COCI '08 Contest 2 #1 Kornislav
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.
The solution is to sort the numbers , , and and output the product of the first and third numbers.
We need to separate the four numbers into two sets, one containing horizontal moves , the other containing vertical moves . The area is then . This expression is maximized when the two smallest numbers are in the same set.
Comments