403175: GYM101061 D Max or Min .. that is the question!

Memory Limit:64 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

D. Max or Min .. that is the question!time limit per test2 secondsmemory limit per test64 megabytesinputstandard inputoutputstandard output

Omar is a very lucky person. One day he found an array of five integers in the middle of the street!

Because Omar loves pre-calculations, he looked at the numbers and immediately marked the maximum number and the minimum number among them, just in case someone asked him about such information!

The next day people started asking questions about the array. Most people asked about the maximum number and the minimum number as expected, but one question was beyond all Omar's expectations! The question was: "what is the maximum number we can get from choosing two distinct numbers from the array, such that their multiplication is as large as possible ?"

It's a sure thing that Omar can easily calculate this information, but as everyone knows .. he is a very busy person. Can you help him answering the question?

Input

The first line of the input contains T the number of test cases.

Each test case is represented with five integers on a single line separated by spaces, the numbers that Omar found. All numbers are positive, distinct integers and less than 1000.

Output

For each test print one integer. The answer to the question above.

ExampleInput
2
1 2 3 4 5
50 40 30 20 10
Output
20
2000

加入题单

算法标签: