ATMs of a well-known bank of a small country are arranged so that they can not give any amount of money requested by the user. Due to the limited size of the bill dispenser (the device that is directly giving money from an ATM) and some peculiarities of the ATM structure, you can get at most k bills from it, and the bills may be of at most two distinct denominations.

For example, if a country uses bills with denominations 10, 50, 100, 500, 1000 and 5000 burles, then at k = 20 such ATM can give sums 100 000 burles and 96 000 burles, but it cannot give sums 99 000 and 101 000 burles.

Let's suppose that the country uses bills of n distinct denominations, and the ATM that you are using has an unlimited number of bills of each type. You know that during the day you will need to withdraw a certain amount of cash q times. You know that when the ATM has multiple ways to give money, it chooses the one which requires the minimum number of bills, or displays an error message if it cannot be done. Determine the result of each of the q of requests for cash withdrawal.

Input

The first line contains two integers n, k (1 ≤ n ≤ 5000, 1 ≤ k ≤ 20).

The next line contains n space-separated integers ai (1 ≤ ai ≤ 107) — the denominations of the bills that are used in the country. Numbers ai follow in the strictly increasing order.

The next line contains integer q (1 ≤ q ≤ 20) — the number of requests for cash withdrawal that you will make.

The next q lines contain numbers xi (1 ≤ xi ≤ 2·108) — the sums of money in burles that you are going to withdraw from the ATM.

Output

For each request for cash withdrawal print on a single line the minimum number of bills it can be done, or print  - 1, if it is impossible to get the corresponding sum.

Examples

Input

6 20
10 50 100 500 1000 5000
8
4200
100000
95000
96000
99000
10100
2015
9950


Output

6
20
19
20
-1
3
-1
-1


Input

5 2
1 2 3 5 8
8
1
3
5
7
9
11
13
15


Output

1
1
1
2
2
2
2
-1
import java.io.*;
import java.math.BigInteger;
import java.util.*;

public class A implements Runnable {

    final boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE") != null;

    BufferedReader in;
    PrintWriter out;
    StringTokenizer tok = new StringTokenizer("");

    public static void main(String[] args) {
        new Thread(null, new A(), "", 128 * (1L << 20)).start();

    }

    void init() throws FileNotFoundException {
        Locale.setDefault(Locale.US);
        if(ONLINE_JUDGE){
            in = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
        }
        else {
            in = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
        }
    }

    long timeBegin, timeEnd;

    void time() {
        timeEnd = System.currentTimeMillis();
        System.err.println("Time = " + (timeEnd - timeBegin));
    }

    public void run() {
        try {
            timeBegin = System.currentTimeMillis();

            init();
            solve();

            out.close();
            time();
        } catch (Exception e) {
            e.printStackTrace(System.err);
            System.exit(-1);
        }
    }


    String readString() throws IOException {

        while (!tok.hasMoreTokens()) {
            try {
                tok = new StringTokenizer(in.readLine());
            } catch (Exception e) {
                return null;
            }
        }
        return tok.nextToken();
    }

    String readString(String s) throws IOException {
        while (!tok.hasMoreTokens()) {
            try {
                tok = new StringTokenizer(in.readLine(), s + "\n \t");
            } catch (Exception e) {
                return null;
            }
        }
        return tok.nextToken();
    }

    double readDouble() throws IOException {
        return Double.parseDouble(readString());
    }

    int readInt() throws IOException {
        return Integer.parseInt(readString());
    }
    long readLong() throws IOException {
        return Long.parseLong(readString());
    }

    int readInt(String s) throws IOException {
        return Integer.parseInt(readString(s));
    }
    boolean isPrime(int a) throws IOException {
        int del=0;
        if(a==2){
            return false;
        }
        for(int i=2;i<Math.sqrt(a)+1;i++){
            if(a%i==0){
                del=i;
                break;
            }
        }
        if(del>0){
            return false;
        }
        else return true;
    }

    public BigInteger bigFactorial(int num) throws IOException {
        BigInteger fact = new BigInteger("1");
        BigInteger i = new BigInteger("1");
        BigInteger one = new BigInteger("1");
        for (int j=0;j<num;j++) {
            fact = fact.multiply(i);
            i=i.add(one);
//out.println(fact.toString()+" "+i.toString());
        }
//fact = fact.add(one);

        return fact;
    }

    public long factorial(int num) throws IOException{
        long res=1;
        for(int i=2;i<=num;i++){
            res*=i;
        }
        return res;
    }
    //Random rd=new Random(System.currentTimeMillis());
    public int[] readIntArr(int n) throws IOException{
        int[] a = new int[n];
        for(int i=0;i<n;i++){
            a[i] = readInt();
            //a[n-i-1] = - a[i];
        }
        return a;
    }

    class Pair implements Comparable{
        int value, q;

        public int getValue() {
            return value;
        }

        public void setValue(int value) {
            this.value = value;
        }

        public int getQ() {
            return q;
        }

        public void setQ(int q) {
            this.q = q;
        }

        @Override
        public int compareTo(Object o) {
            if(this.value>((Pair)o).value){
                return 1;
            }
            if(this.value<((Pair)o).value){
                return -1;
            }
            if(this.value==((Pair)o).value && this.q>((Pair)o).q){
                return 1;
            }
            if(this.value==((Pair)o).value && this.q<((Pair)o).q){
                return -1;
            }

            return 0;
        }

        @Override
        public String toString() {
            return "Pair{" +
                    "value=" + value +
                    ", q=" + q +
                    '}';
        }
    }

    Random rnd=new Random();


    void solve() throws Exception {
        int n=readInt();
        int k=readInt();
        int[] h = readIntArr(n);
        Pair[] a = new Pair[(k)*n];
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < k; j++) {
                a[i*k+j] = new Pair();
                a[i*k+j].value = h[i]*(j+1);
                a[i*k+j].q = j+1;
            }

        }
        Arrays.sort(a);
        int t=readInt();
        while(t-->0){
            int res=Integer.MAX_VALUE;
            int s=readInt();
            for (int i = 0; i < k * n; i++) {
                int x= s-a[i].value;
                if(s == a[i].value) {
                    res = Math.min(res, a[i].q);
                    continue;
                }
                if(s<a[i].value){
                    continue;
                }
                if(s>a[i].value){
                    Pair p = new Pair();
                    p.value = x;
                    p.q = 0;
                    int b = Math.abs(Arrays.binarySearch(a, p))-1;
                    if(b>=a.length)
                        continue;
                    if(a[b].value == x && a[b].value/a[b].q != a[i].value/a[i].q){
                        res = Math.min(res, a[b].q+a[i].q);
                        //System.out.println(a[b].toString()+" "+a[i].toString()+" "+res);
                    }
                }
            }
            System.out.println(res>k?"-1":res);
            //System.out.println("------------------");
        }

    }


}