#P15399. [NOISG 2026 Prelim] Area 2
[NOISG 2026 Prelim] Area 2
Problem Description
Ziv has pairs of sticks, numbered from 1 to . The -th pair consists of two sticks, each of length .
Ziv intends to construct a rectangular frame by selecting two distinct indices and (). The resulting rectangle will have side lengths by , and an area equal to .
Help Ziv find the maximum possible area of a rectangular frame he can construct.
Input Format
Your program must read from standard input.
The first line of input contains one integer .
The next lines of input each contain one integer. The -th of these lines contains .
Output Format
Your program must print to standard output.
Output one integer, the maximum possible area of a rectangular frame Ziv can form.
The output should contain only a single integer. Do not print any additional text such as Enter a number or The answer is.
2
8
9
72
3
16
44
18
792
8
6
7
6
7
99
99
69
1
9801
Hint
Sample Test Case 1 Explanation
Only one frame is possible: with an area of .
Sample Test Case 2 Explanation
There are only 3 frames possible:
The largest area is .
Subtasks
For all test cases, the input will satisfy the following bounds:
- for all
Your program will be tested on input instances that satisfy the following restrictions:
| Subtask | Score | Additional Constraints |
|---|---|---|
| 0 | Sample test cases | |
| 1 | 20 | |
| 2 | ||
| 3 | 60 | No additional constraints |