#include <iostream>
#include <utility>
#include <algorithm>
#include <cmath>
using namespace std;
long long sum[3][100010] = {},a[100010],ans[100010];
pair<int,int> p[100010];
int main(){
	int i,n,q;
	cin >> n >> q;
	for(i=0;i<n;i++){
		cin >> a[i];
		sum[0][i+1] = sum[0][i];
		sum[1][i+1] = sum[1][i];
		sum[i&1][i+1] += a[i];
	}
	for(i=n;i>=1;i--){
		sum[2][i] = sum[2][i+1] + a[i-1];
	}
	for(i=0;i<q;i++){
		int x; cin >> x;
		p[i] = {x,i};
	}
	sort(p,p+q);
	int r = 0;
	for(i=0;i<q;i++){
		while(r<n  && abs(a[r+1] - p[i].first)<abs(a[r] - p[i].first)) r++;
		while(1){
			if(r==n){
				ans[p[i].second] = sum[!(n&1)][n];
				break;
			}
			int l = 2*r - n + 2;
			if(l>=0 && abs(a[l]-p[i].first)<=abs(a[r+1] - p[i].first)){
				ans[p[i].second] = sum[!(l&1)][l] + sum[2][r+2];
				break;
			}
			l = 2*r - n + 3;
			if(l>=0 && abs(a[l] - p[i].first)<=abs(a[r+1] - p[i].first)){
				ans[p[i].second] = sum[(l&1)][l] + sum[2][r+2];
				break;
			}
			r++;
		}
	}
	for(i=0;i<q;i++){
		cout << ans[i] << endl;
	}
}