#include<bits/stdc++.h>
using namespace std;
 
#define DEBUG

typedef long long int ll;
typedef long double ld;
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define MOD (ll)(1e9 + 7)
#define vi vector<int>
#define vii vector<vector<int> >
#define vl vector<ll>
#define vll vector<vector<ll> >
#define vc(T, nm) vector<T> nm
#define pb push_back
#define popb pop_back
#define si set<int>
#define sl set<ll>
#define F first
#define S second
#define pii pair<int, int>
#define mp make_pair
#define ins insert
#define ers erase
#define endl "\n"
#define mul(a, b) ((a % MOD) * (b % MOD)) % MOD
#define adr(a, b) ((a % MOD) + (b % MOD)) % MOD
#define FORA(x, s, e, inc) for(ll x = s; x != e; x += inc)
#define ROFA(x, s, e, inc) for(ll x = s; x != e; x -= inc)
#define FOR(x, s, e) FORA(x, s, e, 1)
#define ROF(x, s, e) ROFA(x, s, e, 1)
#define loop(x, n) FOR(x, 0, n)
#define rd1(t, a) 					t a; cin >> a;
#define rd2(t, a, b) 				rd1(t, a); rd1(t, b); 
#define rd3(t, a, b, c) 			rd2(t, a, b); rd1(t, c);
#define rd4(t, a, b, c, d) 			rd3(t, a, b, c); rd1(t, d);
#define rd5(t, a, b, c, d, e) 		rd4(t, a, b, c, d); rd1(t, e);
#define rd6(t, a, b, c, d, e, f) 	rd5(t, a, b, c, d, e); rd1(t, f);
#define rdA(t, nm, len)				t nm[len]; loop(i, len) {cin >> nm[i];}
#ifdef DEBUG
	#define deb(v) cout << endl << #v << ": " << v << endl
	#define db1(v) cout << endl << #v << ": " << "[ "; for(auto x: v) {cout << x << " ";}; cout << "]" << endl;
	#define db2(v) cout << endl << #v << ": " << endl; for(auto r: v) {cout << "[ "; for(auto x: r) {cout << x << " ";}; cout << "]" << endl;};
	#define dbl cout << "-------------------------------" << endl
#else
	#define deb(v)
	#define db1(v)
	#define db2(v)
	#define dbl
#endif

void solve() {
	rd2(ll, n, q);
	
	vl A(n);
	for(ll i = 0 ; i < n; i++) {
		cin >> A[i];
	}
	sort(A.begin(), A.end());

	vl Q(q);
	for(int i = 0; i < q; i++) {
		cin >> Q[i];
	}
	vl B = Q;
	sort(B.begin(), B.end());

	map<ll, ll> ans;
	ll prev_point = 0;
	ll allc_count = 0;
	ll q_ct = 0;
	ll prev_gap = 0;
	for(ll i = 0; i < n; i++) {

		if(q_ct == Q.size())
			break;

		ll num = A[i];
		ll gap = num - prev_point - 1;
		allc_count += gap;

		while(q_ct < Q.size() and allc_count >= B[q_ct]) {
			ll pick = prev_point + B[q_ct] - prev_gap;
			ans[B[q_ct]] = pick;
			q_ct++;
		}

		prev_point = num;
		prev_gap = allc_count;

	}

	while(q_ct < Q.size()) {
		ll pick = prev_point + B[q_ct] - allc_count;
		ans[B[q_ct]] = pick;
		q_ct++;
	}

	vl ret;

	for(auto x: Q) {
		cout << ans[x] << endl;
	}

}

int main() {
	
	fastio;

	ll t = 1;
	// rd1(ll, t);
	while(t--) {
		solve();
	}

	return 0;
}
#include <iostream>

#include <vector>

#include <algorithm>

using namespace std;

int main() {

    int N, Q;

    cin >> N >> Q;

    vector<long long> A(N);

    for (auto& x : A) {

        cin >> x;

    }

    vector<long long> low(N);

    for (int i = 0; i < N; ++i) {

        low[i] = A[i] - (i + 1);

    }

    while (Q--) {

        long long K;

        cin >> K;

        const int idx = lower_bound(low.begin(), low.end(), K) - low.begin();

        if (idx == N) {

            cout << A[N - 1] + (K - low[N - 1]) << '\n';

        } else {

            cout << A[idx] - (low[idx] - K + 1) << '\n';

        }

    }

    return 0;

}