from heapq import * n = int(input()) *a, = map(int,input().split()) a.sort(reverse=1) q = [(-ai*1.0,1) for ai in a] cnt = 1 Q = int(input()) *k, = map(int,input().split()) ans = [0.0]*Q order = sorted(range(Q),key = lambda i:k[i]) for i in order: for _ in range(k[i]-cnt): v,c = heappop(q) heappush(q,(v*c/(c+1),c+1)) ans[i] = -q[0][0] cnt = k[i] print("\n".join(map(str,ans)))