#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

int n, q;
int a[100010];
ll prefsum[100010];
ll even[100010];
ll odd[100010];

bool solve(int v, int x, int st, int &left, int &right){
    if(st != n - 1){
        int ne = st + 1;
        if(abs(a[ne] - x) < abs(a[st] - x)) st = ne;
    }
    int lo = 0, hi = v;
    while(lo != hi){
        int mi = (lo + hi + 1) >> 1;
        int to_right = mi;
        int to_left = v - mi;
        if(st + mi >= n){
            hi = mi - 1;
            continue;
        }
        if(st - to_left + 1 < 0){
            lo = mi;
            continue;
        }
        int le = st - to_left + 1;
        int ri = st + to_right;
        int dr = abs(a[ri] - x);
        int dl = abs(x - a[le]);
        if(dr >= dl){
            if(le == 0 || abs(x - a[le-1]) > dr) lo = mi;
            else hi = mi - 1;
        }
        else{
            lo = mi;
        }
    }
    int le = st - (v - lo) + 1;
    int ri = st + lo;
    left = le;
    right = ri;
    return ri < n - v;
}

void stupid(int x){
    ll an = 0;
    vector < char > used(n);
    vector < int > b;
    for(int i = 0; i < n; i++) b.push_back(a[i]);
    for(int i = 0; i < n; i++){
        if(i % 2 == 0){
            for(int j = n - 1; j >= 0; j--){
                if(!used[j]){
                    used[j] = true;
                    an += b[j];
                    cout << j << endl;
                    break;
                }
            }
        }
        else{
            int best = 2e9;
            int pos = -1;
            for(int j = 0; j < n; j++){
                if(!used[j]){
                    if(abs(b[j] - x) < best){
                        pos = j;
                        best = abs(b[j] - x);
                    }
                }
            }
            used[pos] = true;
        }
    }
    cout << an << endl;
}

int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin >> n >> q;
    for(int i = 0; i < n; i++){
        cin >> a[i];
//        a[i] = i;
//        cout << a[i] << ' ';
        prefsum[i] = a[i];
        if(i){
            prefsum[i] += prefsum[i-1];
            odd[i] += odd[i-1];
            even[i] += even[i-1];
        }
        if(i % 2 == 0){
            odd[i] += a[i];
        }
        else even[i] += a[i];
    }
//    cout << endl;
    for(int i = 0; i < q; i++){
        int x;
        cin >> x;
//        cout << endl;
//        stupid(x);
        if(x < a[0]){
            cout << prefsum[n-1] - prefsum[n/2 - 1] << '\n';
        }
        else if(x > a[n - 1]){
            if(n & 1) cout << odd[n-1] << '\n';
            else cout << even[n-1] << '\n';
        }
        else{
            auto it = (int)(upper_bound(a, a + n, x) - a - 1);
            int l, r;
            int lo = 0, hi = n / 2;
            while(lo != hi){
                int mi = (lo + hi + 1) >> 1;
                if(solve(mi, x, it, l, r)) lo = mi;
                else hi = mi - 1;
            }
            solve(lo, x, it, l, r);
            if(lo){
                solve(lo, x, it, l, r);
//                cout << lo << ' ' << l << ' ' << r << endl;
                ll sum = prefsum[n-1] - prefsum[n-lo-1];
                if(r + 1 == n - lo){
                    if(l - 1 >= 0){
                        if((l-1) % 2 == 0){
                            sum += odd[l-1];
                        }
                        else sum += even[l-1];
                    }
                }
                else{
                    sum += a[r+1];
                    if(l - 2 >= 0){
                        if((l-2) % 2 == 0){
                            sum += odd[l-2];
                        }
                        else sum += even[l-2];
                    }
                }
                cout << sum << '\n';
            }
            else{
                if(n & 1) cout << odd[n-1] << '\n';
                else cout << even[n-1] << '\n';
            }
        }
    }
    return 0;
}


Measured memory_bytes: 4480