Adjacent Product Game

Choose a subsequence of the given numbers to maximize the sum of products of adjacent chosen pairs.

Medium7Dynamic programmingGreedyNo attempts yetTime limit1sMemory limit64 MB

Problem

Mirko writes NN numbers on a very long sheet of paper. Slavko then takes a pencil and crosses out some of them. Every number that is not crossed out is copied to a new sheet in the original order, and Slavko's score is the sum of the products of each pair of neighboring numbers on the new sheet.

For example, if the copied sequence is 3,6,1,23, 6, -1, 2, then the score is 3×6+6×(1)+(1)×2=103 \times 6 + 6 \times (-1) + (-1) \times 2 = 10. If fewer than two numbers are copied, the score is 00.

Slavko does not know which numbers to cross out to reach the highest score. Write a program that finds the largest score Slavko can reach. There is no limit on how many numbers he crosses out.

Input

The first line contains NN, the count of numbers Mirko wrote. (3N300003 \le N \le 30000)

Each of the next NN lines contains one number XiX_i from Mirko's paper, written with exactly two decimal digits and padded with a trailing zero when needed. (10.00Xi10.00-10.00 \le X_i \le 10.00)

Output

Print the largest score Slavko can reach on the first and only line. Print it with exactly four decimal digits.

Every XiX_i has two decimal digits, so the score is always a multiple of 0.00010.0001.