아직 만들고 있는 페이지입니다.

이 페이지는 아직 만드는 중입니다. 보이는 내용은 바뀔 수 있습니다.

Axis-Aligned Area

시간 제한2초메모리 제한1024 MB

요약
막대기 네 개의 길이가 주어질 때, 각 막대를 좌표축에 평행하게 놓아 둘러싸인 영역의 넓이가 최대가 되도록 배치하는 문제입니다.
난이도

보통10점 중 5점

유형
기하, 수학, 그리디
정답자
아직 제출이 없습니다

문제

Alex has four sticks with positive integer lengths a_1a\_1, a_2a\_2, a_3a\_3, and a_4a\_4 (a_1≤a_2≤a_3≤a_4a\_1 \le a\_2 \le a\_3 \le a\_4).

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 a_1a\_1, a_2a\_2, a_3a\_3, and a_4a\_4, each on a separate line, denoting the lengths of the sticks in non-decreasing order (1≤a_1≤a_2≤a_3≤a_4≤1001 \le a\_1 \le a\_2 \le a\_3 \le a\_4 \le 100).

출력

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.

예제2

  1. 예제 1

    입력
    2
    2
    4
    7
    
    예상 출력
    8
    
  2. 예제 2

    입력
    10
    10
    10
    10
    
    예상 출력
    100