P6420 [COCI 2008/2009 #2] KORNISLAV
Description
The turtle Kornislav never had anything interesting to do. Since he will live for three hundred years, he has been trying to find ways to kill time. This weekend, he started playing a game called “the rectangle with the largest area”.
First, Kornislav needs four positive integers. He forms a pattern by moving in one direction, turning $90°$, walking in the new direction, and so on. In total, Kornislav makes three $90°$ turns and walks along four line segments.
When walking in a direction, the number of steps he takes must be equal to one of the four chosen integers, and each integer can be used as the length of exactly one segment. Depending on the order in which Kornislav uses these four integers, his walk can form different shapes, including some that are not closed.
Write a program to compute the maximum rectangle area that can be formed by the turtle’s path.
Input Format
One line with four integers $a,b,c,d$, representing the four integers chosen by Kornislav.
Output Format
One line with one integer, representing the maximum rectangle area that Kornislav’s path can form.
Explanation/Hint
#### Constraints
For $100\%$ of the testdata, $1