#include <bits/stdc++.h>
using namespace std;
const int MAXA = 1e7 + 10;
const int MAXN = 5010;
bool used[MAXA];
int n, k;
int a[MAXN];
int main() {
  scanf("%d%d", &n, &k);
  memset(used, 0, sizeof(used));
  for (int i = int(0); i < int(n); ++i) {
    scanf("%d", &a[i]);
    used[a[i]] = true;
  }
  int q;
  scanf("%d", &q);
  for (int t = int(0); t < int(q); ++t) {
    int x;
    scanf("%d", &x);
    int ans = -1;
    for (int cnt = int(k + 1) - 1; cnt >= int(1); --cnt) {
      if (x % cnt == 0 && x / cnt < MAXA && used[x / cnt]) {
        ans = cnt;
        continue;
      }
      for (int i = int(0); i < int(n); ++i) {
        if (ans == cnt) break;
        int y = x;
        int k2 = cnt;
        for (int k1 = int(1); k1 < int(cnt); ++k1) {
          y -= a[i];
          k2--;
          if (y < 0) break;
          if (y % k2 == 0 && y / k2 < MAXA && used[y / k2]) {
            ans = cnt;
            break;
          }
        }
      }
    }
    printf("%d\n", ans);
  }
  return 0;
}
