Axis-Aligned Area
시간 제한2초메모리 제한1024 MB
막대기 네 개의 길이가 주어질 때, 각 막대를 좌표축에 평행하게 놓아 둘러싸인 영역의 넓이가 최대가 되도록 배치하는 문제입니다.
문제
Alex has four sticks with positive integer lengths , , , and ().
She wants to place them on a plane in such a way that each stick is parallel to one of the two coordinate axes, and the area enclosed by these sticks is as large as possible.
Find this maximum enclosed area.
입력
The input contains four positive integers , , , and , each on a separate line, denoting the lengths of the sticks in non-decreasing order ().
출력
Print the maximum area that can be enclosed.
힌트
Here is one optimal way to place the sticks on the plane for the first example:

The enclosed area is shaded in gray.