#include <bits/stdc++.h>
using namespace std;
#define modulo 1000000007
#define mod(mod_x) ((((long long)mod_x+modulo))%modulo)
#define Inf 10000000000000000

pair<int,int> check(vector<long long> &A,long long X,long long C){
	int N = A.size();
	
	int R = N-C-1;
	int L = R-C+2;
	//cout<<C<<','<<L<<','<<R<<endl;
	pair<int,int> failed(-1,-1);
	if(L<0)return failed;

	
	if(abs(A[L]-X)>abs(A[R+1]-X))return failed;
	
	if(L!=0)L--;
	
	return make_pair(L,R);
}


int main(){
	
	int N,Q;
	cin>>N>>Q;
	
	vector<long long> A(N);
	for(int i=0;i<N;i++)cin>>A[i];
	
	vector<long long> S(N+1,0);
	for(int i=0;i<N;i++){
		S[i+1] = S[i] + A[i];
	}
	
	vector<long long> S2(N+1,0);
	
	for(int i=0;i<N;i++){
		S2[i+1] = A[i];
		if(i-1>=0)S2[i+1] += S2[i-1];
	}
	
	for(int i=0;i<Q;i++){
		long long X;
		cin>>X;
		
		long long ok = 1;
		long long ng = N+1;
		while(ng-ok>1){
			long long mid = (ok+ng)/2;
			auto ret = check(A,X,mid);
			if(ret.first==-1)ng = mid;
			else ok = mid;
		}
		//cout<<ok<<endl;
		long long ans = S.back() - S[N-ok];
		auto ret = check(A,X,ok);

		ans += S2[ret.first];
		cout<<ans<<endl;
	}
		
	
	return 0;
}