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 Q = int(input[ptr]) ptr += 1 K_list = list(map(int, input[ptr:ptr + Q])) # Sort the rods in descending order to process larger rods first L.sort(reverse=True) sum_L = sum(L) results = [] for K in K_list: if K == 0: results.append(0.0) continue low = 0.0 high = sum_L / K # Initial upper bound # Perform binary search with 100 iterations for precision for _ in range(100): mid = (low + high) / 2 if mid == 0: total = 0 else: total = 0 for li in L: total += li // mid if total >= K: break # Early exit if possible if total >= K: low = mid else: high = mid results.append(low) # Format the results with sufficient precision for result in results: print("{0:.15f}".format(result)) if __name__ == "__main__": main()