#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

long long S[2][100010];


pair<int, int> count_less(long long x, long long turn, vector<long long> &A) {
    ll l = 0;
    ll r = 1000000000ll;
    auto f = [&](long long m) {
        return upper_bound(A.begin(), A.end(), x + m) - lower_bound(A.begin(), A.end(), x - m);
    };
    while (l != r) {
        ll m = (l + r - 1) / 2;
        long c = f(m);
        if (c < turn) {
            l = m + 1;
        } else {
            r = m;
        }
    }

    ll v = f(l);
    int L = static_cast<int>(lower_bound(A.begin(), A.end(), x - l) - A.begin());
    int R = static_cast<int>(upper_bound(A.begin(), A.end(), x + l) - A.begin());
    if (v == turn) return {L, R};
    if (v == turn + 1) {
        return {
                L,
                R - 1
        };
    }
    cout << v << " " << l << " " << r << " " << "|" << turn << " " << v << " " << L << "|" << R << endl;
    assert(0);
}

long long sm(int p, int l, int r) {
    return S[p][r] - S[p][l];
}

void solve(long long N, long long Q, vector<long long> A, vector<long long> X) {
    rep(i, N) {
        S[i % 2][i + 1] += A[i];
    }
    for (int i = 0; i < 2; i++) {
        for (int j = 0; j < N; j++) {
            S[i][j + 1] += S[i][j];
        }
    }

    int l = N;
    auto f = [&](ll x) {
        while(true){
            auto seg = count_less(x, l, A);
            if (seg.second > N - l) {
                l--;
            }else{
                break;
            }
        }
//        cout << l << " " << r << endl;

        ll sum = sm(0, N - l, N) + sm(1, N - l, N);

        auto seg = count_less(x, l, A);

        int flg = N - l - seg.second == 1;
        sum += flg * A[N - l - 1];

//    cout << "[" << seg.first << " " << seg.second << "|" << l << N - l - seg.second << endl;

        ll le = max(0, seg.first - 1 - flg);
        sum += sm(le%2, 0, seg.first - flg);
        return sum;
    };

    auto g = [&](ll x){
        set<ll> S(A.begin(), A.end());
        ll sc = 0;
        while( S.size() ){
            sc += *S.rbegin();
            S.erase(*S.rbegin());
            if(S.empty()) break;
            auto it = S.lower_bound(x);
            auto it2 = it;
            if( it2 != S.begin() ) it2--;
            if( abs(*it - x) >= abs(x - *it2)){
                S.erase(*it2);
            }else{
                S.erase(*it);
            }
        }
        return sc;
    };

    vector<ll> res(X.size());

    vector<pair<long long,int>> xx;
    for(int i = 0 ; i < X.size() ; i++) xx.push_back({X[i], i});
    sort(xx.begin(), xx.end());
    for (auto &x : xx) {
        res[x.second] = f(x.first);
    }
    for( auto &x: res){
        cout << x << endl;
    }

}

int main() {

    long long N;
    scanf("%lld", &N);
//    N = 100;
    long long Q;
    scanf("%lld", &Q);
//    Q = 100;
    vector<long long> A(N);
    for (int i = 0; i < N; i++) {
        scanf("%lld", &A[i]);
//        A[i] = rand() % 100 + (i?A[i-1]:0) + 1;
    }
    vector<long long> X(Q);
    for (int i = 0; i < Q; i++) {
        scanf("%lld", &X[i]);
//        X[i] = A[i];
    }
    solve(N, Q, A, X);
//    cout << "No submit" << endl;
    return 0;
}


Measured memory_bytes: 8944