#include <iostream>
#include <vector>
#include <algorithm>
#define INF (1<<30)
using namespace std;


int main(){
    int N,Q;cin>>N>>Q;
    
    vector<int> nos(N);
    for(int i=0;i<N;i++) cin>>nos[i];
    reverse(nos.begin(),nos.end());
    
    vector<pair<int,int>> queries(Q);
    for(int i=0;i<Q;i++) cin>>queries[i].first;
    for(int i=0;i<Q;i++) queries[i].second = i;
    sort(queries.begin(),queries.end());

    vector<pair<int,int>> intervals;
    for(int i=0;i<nos.size();i++){
        int l = -INF, r = INF;
        if(2*i < nos.size()) l = (nos[i] + nos[2*i])/2 + 1;
        if(i%2 == 0) r = (nos[i/2] + nos[i])/2;
        intervals.push_back(make_pair(l,nos[i]));
        intervals.push_back(make_pair(r+1,-nos[i]));
    }
    sort(intervals.begin(), intervals.end());
    
    long long total = 0;
    vector<long long> ans(Q);
    for(int i=0,j=0;i<queries.size();i++){
        int x = queries[i].first;
        while(intervals[j].first <= x) total += intervals[j++].second;
        ans[queries[i].second] = total;
    }

    total = 0;
    for(int i=0;i<N;i++) total += nos[i];
    for(int i=0;i<Q;i++) cout<<total - ans[i]<<endl;
    return 0;
}