for i in range(1, 1 + input()):
    ca = raw_input()
    ca = map(int, raw_input().split())
    cb = []
    cz = []
    for ci in range(len(ca)):
        cb += map(int, raw_input().split())
        cb[ci].sort
    
    cc = [ x/ca[0] for x in ca ]
    cmin = [ x * 9.0 / 22 for x in ca]