Logo
(追記) (追記ここまで)

35008번 - Garden Bed 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 2048 MB38262074.074%

문제

In a wonderful land where the sun shines brighter and flowers grow more lushly, there lived a kind gardener named Nikolay. He eagerly awaited the time to open the gardening season and engage in his favorite activity: cultivating garden beds.

One day, gathering his strength, Nikolay brought a few magical pairs of boards with him. Boards from the same pair had the same length, whereas boards from different pairs may have had different lengths. Nikolay dreamed of creating a beautiful rectangular garden bed where the prettiest vegetables and flowers would grow. For that, he needed to use all his boards without cutting them, placing paired boards on the opposite sides of the rectangle.

And so, standing in front of his garden, Nikolay pondered: "What can be the area of a beautiful garden bed?" Help him determine the minimum and maximum positive area he could obtain.

입력

The first line contains an integer $n$: the number of pairs of boards (2ドル \le n \le 7$).

The second line contains $n$ integers: the lengths of boards in the first, second, \ldots, $n$-th pair. Each length is an integer from 1ドル$ to 10ドル^8$.

출력

Output two integers: the minimum and maximum area of a beautiful garden bed.

제한

예제 입력 1

2
10 239

예제 출력 1

2390 2390

예제 입력 2

3
1 2 2

예제 출력 2

4 6

노트

출처

ICPC > Regionals > Northern Eurasia > Northwestern Russia Regional Contest > ICPC 2025-2026 Northwestern Russia Qualification E번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /