Spacecraft
topic description
Install rectangular and square solar panels on one side of the spacecraft (the slash area in the figure);
two pillars (the black vertical bars in the figure) need to be installed first;
and then fix the solar panels in the middle of the pillars;
but the spacecraft The length of the pillar is different in different positions;
the installation area of the solar panel is limited by the length of the pillar on the shortest side;
Now provide a set of pillar height data of an integer array;
assume that the distance between each pillar is equal to a unit length;
calculate how to choose two pillars to maximize the area of the solar panel;
enter description
10,9,8,7,6,5,4,3,2,1
Note, there are at least two pillars and a maximum of 10,000, and the supported height range is an integer from 1 to 10^9
The heights of the columns are unordered and
the decrement in the example is a coincidence
output description
Maximum solar panel area that can be supported: (between 10m high pillar and 5m high pillar)
25
example one
enter
10,9,8,7,6,5,4,3,2,1
output
25
Remark
The width between the 10-meter-high pillar and the 5-meter-high pillar is 5, and the height of the smaller pillar is also 5, and the area is 25.
Any area that can be obtained by the other two pillars is equal to 5.