Time Limit:1000ms Memory Limit:65536KB

Description

Have you heard KOF-Style match? If not, let me explain it to you.
There are two teams, and each team have n players. Before the match each team
gives a lable to the players belong to the team. The label is from 1 to n.Now, we
call them player_1, player_2, and so on.Then player_1 of the first team compete
to the player_1 of the second team.If the player of the first team wins, he will
compete to player_2 of the second team, vice versa, untill one team has no person
left.It's clearly that once a person loses, he can't compete again.
Now, here comes the problem, if we know the probability player_i of the first
team can defeat play_j of the second team, you are required to calculate the
probability that the first team defeat the second team.We assume n = 5 here.

Input

The first line is an integer T which stands for the number of test cases.
Each test case has 5 lines, and each line is 5 float number seperated by a space.
The jth number of the ith line is the probability that the play_i of the first
team can defeat the play_j of the second team.
Each float number is between 0 and 1.

Output

For each test case, output the answer in a single line and retain 8 digits
after the decimal point.

Sample Input

1
1.000000 1.000000 1.000000 1.000000 1.000000
1.000000 1.000000 1.000000 1.000000 1.000000
1.000000 1.000000 1.000000 1.000000 1.000000
1.000000 1.000000 1.000000 1.000000 1.000000
1.000000 1.000000 1.000000 1.000000 1.000000

Sample Output

1.00000000

Hint


Author

baihacker

Source

Preliminary (Single)