AtCoder Beginner Contest 071
C
Make a Rectangle
AtCoder
⌀ 589
原题
← BD →
翻译中…

Problem Statement

翻译中…

We have $N$ sticks with negligible thickness. The length of the $i$-th stick is $A_i$.

翻译中…

Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle.

翻译中…

Constraints

翻译中…
  • $4 \leq N \leq 10^5$
  • $1 \leq A_i \leq 10^9$
  • $A_i$ is an integer.
翻译中…

Input

翻译中…

Input is given from Standard Input in the following format:

翻译中…

N
A_1 A_2 ... A_N

翻译中…

Output

翻译中…

Print the maximum possible area of the rectangle. If no rectangle can be formed, print $0$.

翻译中…

样例

Input #1
6
3 1 2 4 2 1
Output #1
2
$1 \times 2$ rectangle can be formed.
Input #2
4
1 2 3 4
Output #2
0
No rectangle can be formed.
Input #3
10
3 3 3 3 4 4 4 5 5 5
Output #3
20
题目信息
题号
arc081_a
时间限制
2 s
内存限制
256 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。