import sys input = sys.stdin.readline # Consider adding epsilon to a single breaks pushup count # Greedily, we would want to add it to the break that # would add minimal stress # The optimal distribution will then be when the derivative # of all functions evaluated at their distribution is # all equal # let the derivative be d: # d = 2x_i / t_i -> x_i = d*t_i / 2 # Sum of d*t_i / 2 = p -> d = 2p / sum of t_i # x_i = p*t_i / sum of t_i # Stress = sum of (x_i ^ 2 / t_i) # = sum of ((p*t_i / sum of t_i)^2 / t_i) # = (p / sum of t_i)^2 * sum of (t_i^2 / t_i) # = p^2 / sum of t_i def solve(): n, p = map(int, input().split()) ans = p**2 / sum(map(int, input().split())) print(f"{ans:0.10f}") t = int(input()) for ti in range(t): solve()