from heapq import heappop, heappush, heapify n = int(input()) l = list(map(int, input().split())) d = [0] * (5 * 10 ** 5 + 1) cnt = [0] * n q = [(-l[i], i) for i in range(n)] heapify(q) for c in range(1, 5 * 10 ** 5 + 1): x, i = heappop(q) x = -x d[c] = x cnt[i] += 1 heappush(q, (-l[i] / (cnt[i] + 1), i)) input() for k in map(int, input().split()): print(d[k])