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

#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define trav(a, x) for(auto& a : x)
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x).size()
#define hash dhsjakhd
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef long double ld;

ll n,m,T,k,q;
const ll big = 1000000007;
const ll big2 = 998244353;

ll x;
vl A;

ll CS[200002] = {0};
ll CSA[200002] = {0};

// --[++
ll bs1(ll x2){
    ll l = 0;
    ll r = n;
    if(A[0] >= x2)return 0;
    while(l < r-1){
        ll mid = (l+r)/2;
        if(A[mid] >= x2){
            r = mid;
        }
        else{
            l = mid;
        }
    }
    return r;
}

//  ++)--
ll bs2(ll x2){
    ll l = 0;
    ll r = n-1;
    if(A[n-1] < x2)return n-1;
    while(l < r-1){
        ll mid = (l+r)/2;
        if(A[mid] < x2){
            l = mid;
        }
        else{
            r = mid;
        }
    }
    return l;
}


bool mark[100001] = {0};

ll brute(ll x){
    for(int c1 = 0; c1 < n; c1++){mark[c1] = 0;}
    ll ans = 0;
    for(int c1 = 0; c1 < n; c1++){
        if(c1%2 == 0){
            for(int c1 = n-1; c1 >= 0; c1--){
                if(!mark[c1]){
                    mark[c1] = 1;
                    ans += A[c1];
                    break;
                }
            }
        }
        else{
            ll midiff = 2e9;
            ll choose = 0;
            for(int c1 = 0; c1 < n; c1++){
                if(!mark[c1]){
                    ll temp = abs(A[c1]-x);
                    if(temp < midiff){
                        midiff = temp;
                        choose = c1;
                    }
                }
            }
            mark[choose] = 1;
        }
    }
    return ans;
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    //freopen("input.txt","r",stdin);
    //freopen("autput.txt","w",stdout);
    ll a,b,c,e;

    cin >> n >> q;
    for(ll c1 = 0; c1 < n; c1++){
        cin >> a;
        A.push_back(2*a);
    }
    CS[0] = 0;
    for(ll c1 = 0; c1 < n; c1++){
        CS[c1+1] = CS[c1]+A[c1];
        CSA[c1] = A[c1];
        if(c1 > 1)CSA[c1] += CSA[c1-2];
    }

    for(ll c1 = 0; c1 < q; c1++){
        cin >> x;
        x *= 2;
        if(x >= A[n-2]){
            cout << CSA[n-1]/2 << "\n";
            continue;
        }
        if(x <= A[0]){
            ll ans = CS[n]-CS[n/2];
            cout << ans/2 << "\n";
            continue;
        }

        ll l = 0;
        ll r = 3e9;
        while(l < r-1){
            ll mid = (l+r)/2;
            ll i1 = bs1(x-mid);
            ll i2 = bs2(x+mid);
            a = i2-i1+1;
            b = n-i2-1;
            if(a <= b){
                l = mid;
            }
            else{
                r = mid;
            }
           // cerr << l << " " << r << "\n";
        }

        k = n-bs2(x+l)-1;
        ll res = CS[n]-CS[n-k] + CSA[n-2*k-1];
        cout << (CS[n]-CS[n-k] + CSA[n-2*k-1])/2 << "\n";


    /*
        ll res2 = brute(x);
        if(res2 != res){
            cerr << "!!!  x: " <<  x << "   " << res << " " << res2 << "\n";

        }
*/
    }
    return 0;
}


Measured memory_bytes: 4212