import java.io.*; import java.util.*; import java.util.stream.*; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(); int n = sc.nextInt(); PriorityQueue queue = new PriorityQueue<>(); for (int i = 0; i < n; i++) { queue.add(-sc.nextInt()); } double[] ans = new double[500001]; TreeSet polls = new TreeSet<>(); ans[1] = -queue.poll(); polls.add(new Poll(polls.size(), ans[1], 2)); for (int i = 2; i <= 500000; i++) { if (queue.size() == 0 || polls.last().value() > -queue.peek()) { Poll p = polls.pollLast(); ans[i] = p.value(); p.add(); polls.add(p); } else { ans[i] = -queue.poll(); polls.add(new Poll(polls.size(), ans[i], 2)); } } int q = sc.nextInt(); StringBuilder sb = new StringBuilder(); while (q-- > 0) { sb.append(new java.math.BigDecimal(ans[sc.nextInt()]).toPlainString()).append("\n"); } System.out.print(sb); } static class Poll implements Comparable { int idx; double current; int size; public Poll(int idx, double current, int size) { this.idx = idx; this.current = current; this.size = size; } public double value() { return current / size; } public void add() { size++; } public int compareTo(Poll another) { if (value() == another.value()) { return idx - another.idx; } else if (value() < another.value()) { return -1; } else { return 1; } } public int hashCode() { return idx; } public boolean equals(Object o) { return hashCode() == o.hashCode(); } } } class Utilities { static String arrayToLineString(Object[] arr) { return Arrays.stream(arr).map(x -> x.toString()).collect(Collectors.joining("\n")); } static String arrayToLineString(int[] arr) { return String.join("\n", Arrays.stream(arr).mapToObj(String::valueOf).toArray(String[]::new)); } } class Scanner { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(""); StringBuilder sb = new StringBuilder(); public Scanner() throws Exception { } public int nextInt() throws Exception { return Integer.parseInt(next()); } public long nextLong() throws Exception { return Long.parseLong(next()); } public double nextDouble() throws Exception { return Double.parseDouble(next()); } public int[] nextIntArray() throws Exception { return Stream.of(br.readLine().split(" ")).mapToInt(Integer::parseInt).toArray(); } public String next() throws Exception { while (!st.hasMoreTokens()) { st = new StringTokenizer(br.readLine()); } return st.nextToken(); } }