from heapq import heappush, heappop N = int(input()) L = list(map(int,input().split())) heap = [] for i in range(N): heappush(heap, (-L[i], i)) M = 500000 ans = [0] * (M+1) cnt = [0] * N for i in range(1,M+1): A,P = heappop(heap) A *= -1 ans[i] = A cnt[P] += 1 heappush(heap, (-(L[P] / (cnt[P] + 1.0)), P)) Q = int(input()) K = list(map(int,input().split())) for i in range(Q): print(ans[K[i]])