MAXEQUA - Maximizing the equation

Given 3 sequences of positive numbers A,B and C. Your mission is to maximize this equation:

Z = A[i] / (B[j] * C[k]).

In other words, you have to choose any numbers from the given sequences in order to maximize Z.

Input

First line contains a positive integer T which is the number of test cases. Each test case has the following format:

N

A[0] A[1] A[2] ... A[N-1]

M

B[0] B[1] B[2] ... B[M-1]

P

C[0] C[1] C[2] ... C[P-1]

Constraints

1 <= T <= 100

1 <= N, M, P <= 10000

1 <= A[i], B[i], C[i] <= 1000

Output

Print T lines, one for each test case that contains the maximum Z rounded to 2 decimal places.

Sample

Input
2
3
1 2 3
4
5 6 7 8
3
10 2 6
1
5
1
4
2
1 2

Output
0.30
1.25

Added by:Gareev
Date:2012-10-05
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64
Resource:AUC Local contest

hide comments
2012-10-05 14:35:57 Damian Straszak
please move to tutorial
2012-10-05 13:31:41 Francky
Is it a joke ?
It's not for tutorial, it's to be hidden.
Even in tutorial is a bad idea, as a python solution would be impossible or very hard !

Last edit: 2012-10-05 17:00:32
2012-10-05 12:13:52 Ehor Nechiporenko
Too trivial for classical
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.