import heapq def read_data(): N = int(input()) Ls = list(map(int, input().split())) Q = int(input()) Ks = list(map(int, input().split())) return N, Ls, Q, Ks def solve(N, Ls, Q, Ks): Kmax = max(Ks) ws = [0] * (Kmax + 1) Ls.sort(reverse=True) hq = [(-L, 1, L) for L in Ls] for k in range(1, Kmax + 1): w, n, L = hq[0] ws[k] = - w heapq.heapreplace(hq, (- L / (n + 1), n + 1, L)) return [ws[k] for k in Ks] N, Ls, Q, Ks = read_data() result = solve(N, Ls, Q, Ks) for w in result: print(w)