Kelvin loves large number.
He likes his height being a large number.
He likes his income being a large number.
He likes his number of girlfriends being a large number... no, maybe not.
Anyway, so when he stares at a list of numbers, he can't help multiplying some of them together to obtain a large number.
Now he is staring at some N numbers, he wonders if he multiply some (at least one) of them together, how large at most can the product be?
One the first line is the integer T, indicating the number of testcases.
In each testcase, the testcase starts with a number N, being the amount of numbers in the list. Then cames the N numbers ai in the list.
T <= 100
N <= 2000
|ai| <= 10000
For each testcase, output a number in a line indicating the maximum product Kelvin can get by multiplying some of the numbers (at least one) in the list together.
3 4 10000 10000 10000 10000 3 -1 -2 -3 6 1 -2 3 -4 5 -6
10000000000000000 6 360
Migrated from old NTUJ.
kelvin
No. | Testdata Range | Score |
---|