import java.io.*; import java.util.*; public class Main_yukicoder68 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); Printer pr = new Printer(System.out); int n = sc.nextInt(); // int[] l = new int[n]; PriorityQueue pq = new PriorityQueue<>(n); for (int i = 0; i < n; i++) { // l[i] = sc.nextInt(); pq.add(new Pair(sc.nextInt(), 1)); } double[] ans = new double[500_000 + 1]; for (int i = 1; i <= 500_000; i++) { Pair e = pq.remove(); ans[i] = (double)e.a / e.b; e.b++; pq.add(e); } int q = sc.nextInt(); for (int i = 0; i < q; i++) { int k = sc.nextInt(); pr.printf("%.10f\n", ans[k]); } pr.close(); sc.close(); } private static class Pair implements Comparable { int a; int b; Pair(int a, int b) { this.a = a; this.b = b; } @Override public int compareTo(Pair o) { double tmp1 = (double)a / b; double tmp2 = (double)o.a / o.b; if (tmp1 == tmp2) { return Integer.compare(this.b, o.b); } return Double.compare(tmp2, tmp1); } } @SuppressWarnings("unused") private static class Scanner { BufferedReader br; Iterator it; Scanner (InputStream in) { br = new BufferedReader(new InputStreamReader(in)); } String next() throws RuntimeException { try { if (it == null || !it.hasNext()) { it = Arrays.asList(br.readLine().split(" ")).iterator(); } return it.next(); } catch (IOException e) { throw new IllegalStateException(); } } int nextInt() throws RuntimeException { return Integer.parseInt(next()); } long nextLong() throws RuntimeException { return Long.parseLong(next()); } float nextFloat() throws RuntimeException { return Float.parseFloat(next()); } double nextDouble() throws RuntimeException { return Double.parseDouble(next()); } void close() { try { br.close(); } catch (IOException e) { // throw new IllegalStateException(); } } } private static class Printer extends PrintWriter { Printer(PrintStream out) { super(out); } } }