Tianjin University Online Judge
Contests Virtual Contests Problems Submit Runs Status Rank List Forum

3490.   Nisoku
Time Limit: 2.0 Seconds   Memory Limit: 65536K
Total Runs: 258   Accepted Runs: 134

Miss Kim and Mr. Han are playing a game called Nisoku, which is played as follows. Initially, there is a pile of cards. Each card contains a real number between 1.5 and 10.0, inclusive. You are given N doubles, the i-th element of which is written on the i-th card. Repeat the following step until there is only one card left in the pile: Remove any two cards from the pile, and add one new card to the pile. Write either a+b or a*b on the new card, where a and b are the numbers written on the two cards that were removed.


The first line will contain the number of test cases. Each case has two lines of input. The first line will contain a integer N(2 ≤ N ≤ 50) indicating the number of cards. The second line will contain N doubles corresponding to the real number written on the i-th card, separated by spaces.


For each case output the maximal possible number written on the final card in a line. Round the number in the output to 6 digits after decimal point.

Sample Input

5 8
1.5 1.8
8.26 7.54 3.2567
1.5 1.7 1.6 1.5

Sample Output


Source: TJU Team Selection Contest 2010 (2)
Submit   List    Runs   Forum   Statistics

Tianjin University Online Judge v1.3.0
Maintance:Fxz. Developer: SuperHacker, G.D.Retop, Fxz