import bisect def main(): import sys input = sys.stdin.read().split() ptr = 0 N = int(input[ptr]) ptr += 1 L = list(map(int, input[ptr:ptr+N])) ptr += N L.sort() Q = int(input[ptr]) ptr += 1 K_list = list(map(int, input[ptr:ptr+Q])) ptr += Q max_L = L[-1] if N > 0 else 0 for K in K_list: low = 0.0 high = float(max_L) for _ in range(100): mid = (low + high) / 2 if mid == 0: current_sum = 0 else: idx = bisect.bisect_left(L, mid) current_sum = 0 for i in range(idx, N): current_sum += L[i] // mid if current_sum > K * 2: # Early exit if sum exceeds K significantly break if current_sum >= K: low = mid else: high = mid print("{0:.15f}".format(low)) if __name__ == "__main__": main()