| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 | 2048 MB | 38 | 26 | 20 | 74.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.
2 10 239
2390 2390
3 1 2 2
4 6