Time limit
2s
Memory limit
128 MB
You are given N (3 ≤ N ≤ 40) sticks. Some sticks may have the same length, and others may have different lengths. Divide all sticks into three groups without leaving any stick unused. In each group, connect the sticks in a straight line to form one side of a triangle.
Find the largest possible area of a triangle that can be made this way.
The first line contains the integer N. Each of the next N lines contains one stick length L (1 ≤ L ≤ 40).
Print the integer obtained by multiplying the maximum possible area by 100 and discarding the fractional part. If no triangle can be made, print -1.
If a triangle has side lengths a, b, and c, and s = (a + b + c) / 2, then the square of its area is s × (s - a) × (s - b) × (s - c).