

Time Limit: 2 sec / Memory Limit: 256 MB
配点 : 点
問題文
太さが無視できる棒が 本あります. 番目の棒の長さは です.
すぬけ君は,これらの棒から 本の異なる棒を選び,それらの棒を辺として長方形(正方形を含む)を作りたいです. 作ることができる最大の長方形の面積を求めてください.
制約
- は整数
入力
入力は以下の形式で標準入力から与えられる。
...
出力
すぬけ君が作ることのできる最大の長方形の面積を出力せよ. ただし,長方形を作れない場合は, を出力せよ.
入力例 1Copy
6 3 1 2 4 2 1
出力例 1Copy
2
の長方形を作ることができます.
入力例 2Copy
4 1 2 3 4
出力例 2Copy
0
長方形を作ることはできません.
入力例 3Copy
10 3 3 3 3 4 4 4 5 5 5
出力例 3Copy
20
Score : points
Problem Statement
We have sticks with negligible thickness. The length of the -th stick is .
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
- is an integer.
Input
Input is given from Standard Input in the following format:
...
Output
Print the maximum possible area of the rectangle. If no rectangle can be formed, print .
Sample Input 1Copy
6 3 1 2 4 2 1
Sample Output 1Copy
2
rectangle can be formed.
Sample Input 2Copy
4 1 2 3 4
Sample Output 2Copy
0
No rectangle can be formed.
Sample Input 3Copy
10 3 3 3 3 4 4 4 5 5 5
Sample Output 3Copy
20