from heapq import heappush, heappop n = int(input()) L = list(map(int,input().split())) Q = int(input()) K = list(map(int,input().split())) M = 5*10**5+5 size = [1]*n h = [] for i,l in enumerate(L): heappush(h,[-l,i]) ans = [0]*M for i in range(1,M): x,ind = heappop(h) x *= -1 ans[i] = x size[ind] += 1 heappush(h,[-L[ind]/size[ind],ind]) for k in K: print(ans[k])