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(reverse=True) # Sort in descending order max_L = L[0] if N > 0 else 0 Q = int(input[ptr]) ptr += 1 K_list = list(map(int, input[ptr:ptr+Q])) for K in K_list: if K == 0: print("0.0") continue low = 0.0 high = max_L for _ in range(100): mid = (low + high) / 2 if mid == 0: cnt = 0 else: cnt = 0 for li in L: if li < mid: break # Remaining elements are smaller, so break early add = li // mid cnt += add if cnt >= K: break # Early exit if count exceeds K if cnt >= K: low = mid else: high = mid # Format the output to required precision print("{0:.15f}".format(low)) if __name__ == "__main__": main()