1627 - After Dating With Girl

Time Limit : 1 Second

Memory Limit : 128 MB

Submission: 2

Solved: 2

Description
After dating with girl, night is coming. Now the boy (Hellis is a little bad guy) and the girl want to papapa together.

Before papapa, the girl orders the boy to solve the following problem.


There is a box of dominoes blocks. In the box, there are 12 different blocks, which are shown above. Tom is a boy who likes to do practice in intelligence, so he spends a whole afternoon in finishing two different rectangles with 3 * 20, which are shown below.


These are the only solutions for 3 * 20, and he has to know the number of solutions for M * N.



You should notice that if one solution is identical with the other by some flip or rotation, these two solutions should be considered as the same.

It is an old problem so that everybody can solve it easily, and we just define K as the answer of the old problem.

Then the more difficult problem comes:


(x, y, z, w can be decimals)

Hellis wants to papapa quickly, so you need to make the maximum value of f.



Input
The first line contains a single integer T, the number of test cases.

Each contains a single line with 6 positive integers M , N (which means the shape of M * N. Here M * N = 60) , A, B, C, D (A, B, C, D <50000).

Output
For each test case, output a line contains the maximum value of f accurate to 0.01 (Each coordinate keep 3 digits after decimal point).

sample input
2
3 20 36 35 44 33
1 60 20 20 10000 20
sample output
2.66
2.00
hint
source
The 8th(2013) ACM Programming Contest of HUST
© 2015 HUST ACMICPC TEAM. All Right Reserved.