function Main(input) {
	var sum  = function(arr) {
		var sum = 0;
		arr.forEach(function(elm) {
			sum += elm;
		});
		return sum;
	};	
	input = input.trim().split("\n").map(function(x) { return x.split(" ")});
	var N = parseInt(input[0][0], 10);
	var Q = parseInt(input[0][1], 10);
	var vec_A = input[1].map(e => parseInt(e, 10));
	var arr_X =[];
	for (var i =0; i < Q; i++){
		arr_X.push([parseInt(input[i + 2][0], 10), i]);
	}
	arr_X.sort((a, b) => a[0] - b[0]);
	var indexMap = Array.from({length: Q}, () => 0);
	for (var i = 0; i < Q; i++){
		indexMap[arr_X[i][1]] = i;
	}
	// console.log(arr_X);
	//vec_ans[indexMap[i]]を後から参照していけ

	var lastNum = vec_A[N - 1]; //この数は必ず高橋くんの得点になるので無視
	vec_A.pop();
	N -= 1;

	var border = vec_A[Math.ceil(N / 2)];
	border = Math.floor((border + vec_A[0]) / 2) + 1; //xがborder未満である限り、各者の得点は定数
	// console.log("border", border);

	var allSum = lastNum; //既に除いた末尾のカードは含める（この変数のみ）
	var minAokiSum = 0;
	var vec_oddSum = [0];
	var vec_evenSum = [0];
	var vec_countA =[0];
	var tmp = [0, 0];


	for (var i = 0; i < N; i++){
		allSum += vec_A[i];
		if ((i + 1) <= Math.ceil(N / 2)) minAokiSum += vec_A[i];
		if (i % 2 === 1) vec_oddSum.push(vec_oddSum[vec_oddSum.length - 1] + vec_A[i]);
		else vec_evenSum.push(vec_evenSum[vec_evenSum.length - 1] + vec_A[i]);
		for (var j = tmp[0]; j < vec_A[i]; j++){
			vec_countA[j] = tmp[1];
		}
		tmp[0] = vec_A[i];
		tmp[1] ++;
	}
	vec_countA.push(tmp[1]);
	vec_oddSum.shift();
	vec_evenSum.shift();



	var qi = 0; 
	var vec_AokiScore = [];
	while (qi < Q && arr_X[qi][0] < border){
		vec_AokiScore.push(minAokiSum);
		qi ++;
	}

	var tmpSlotSize = Math.ceil(N / 2);
	var tmpSlot = vec_A.slice(0, tmpSlotSize);
	var sumSlotOld = sum(tmpSlot);
	var sumSlotNew = 0;
	var tmpRemainedSize, tmpFreeSlotSize, sharedSize;
	var tmpCandidate = [];
	var tmpX, tmpLeftStartIndex, tmpRightStartIndex, afterDivisionIndex;
	var countLeftBack = 0;
	// console.log("here", vec_AokiScore);


	for (qi = qi; qi < Q; qi++){
		tmpX = arr_X[qi][0]
		// console.log(vec_A[vec_A.length - 1], tmpX, vec_A[vec_A.length - 1] <= tmpX);
		if (vec_A[vec_A.length - 1] <= tmpX){
			tmpSlot = [];
			sumSlotNew = 0;
			tmpCandidate = [];
			afterDivisionIndex = N - 1;
		} else {
			// console.log("qi",qi);
			tmpRemainedSize = Math.max(0, vec_countA[tmpSlot[tmpSlotSize - 1]] - vec_countA[tmpX - 1]);
			tmpFreeSlotSize = tmpSlotSize - tmpRemainedSize;
			// console.log("X", tmpX);
			tmpLeftStartIndex = vec_countA[tmpX - 1] - 1;
			tmpRightStartIndex = vec_countA[Math.max(tmpSlot[tmpSlotSize - 1] + 1, tmpX) - 1]; 
			// console.log("LR", tmpLeftStartIndex, tmpRightStartIndex, vec_countA, Math.max(tmpSlot[tmpSlotSize - 1] + 1, tmpX), Math.max(tmpSlot[tmpSlotSize - 1] + 1, tmpX) - 1);
			sharedSize = N - tmpRightStartIndex;
			for (var j = 0; j < tmpFreeSlotSize; j++){
				tmpCandidate.push([tmpLeftStartIndex - j, vec_A[tmpLeftStartIndex - j], Math.abs(tmpX - vec_A[tmpLeftStartIndex - j]), 0]); //最後の要素が0なら左に戻るのでsharedSizeは減らず
				if (tmpRightStartIndex + j < N) tmpCandidate.push([tmpRightStartIndex + j, vec_A[tmpRightStartIndex + j], Math.abs(tmpX - vec_A[tmpRightStartIndex + j]), 1]); //最後の要素が1なら右にいくのでsharedSizeが減っていく。
				// console.log("j", j, tmpCandidate);
			}
			tmpCandidate.sort(function(a, b){
				if (a[2] > b[2]) return 1;
				if (a[2] < b[2]) return -1;
				// 得点は降順
				if (a[0] > b[0]) return 1;
				if (a[0] < b[0]) return -1;
				return 0;
			});
			// console.log("TC", tmpCandidate);
			
			countLeftBack = 0;
			sumSlotNew = 0;
			tmpSlot = [];
			var j = 0;
			division_loop:
			while(true){
				// console.log(j, "SS", sharedSize, countLeftBack);
				sumSlotNew += tmpCandidate[j][1];
				tmpSlot.push(tmpCandidate[j][1]);
				if (tmpCandidate[j][3] === 1) sharedSize --;
				if (tmpCandidate[j][3] === 0) countLeftBack ++;
				if (sharedSize === 0){ //AokiのターンでTakahashiとの境界線に到達
					afterDivisionIndex = tmpLeftStartIndex - countLeftBack - 1;
					break division_loop;
				};
				sharedSize --;
				if (sharedSize === 0){ //Takahashiのターンで境界線に
					afterDivisionIndex = tmpLeftStartIndex - countLeftBack;
					break division_loop;
				}
				j ++;
			}
		}
		// console.log("ADI", afterDivisionIndex, sumSlotNew, vec_evenSum, vec_oddSum);
		if (afterDivisionIndex % 2 === 0) vec_AokiScore.push(vec_evenSum[afterDivisionIndex / 2] + sumSlotNew);
		if (afterDivisionIndex % 2 === 1) vec_AokiScore.push(vec_oddSum[(afterDivisionIndex - 1) / 2] + sumSlotNew); 
		
		// console.log("result", afterDivisionIndex, vec_AokiScore, countLeftBack);

		tmpCandidate = [];
		tmpSlotSize = tmpSlot.length;
	
	}


	var vec_TakahashiScore = [];
	for (var i = 0; i < Q; i++){
		vec_TakahashiScore.push(allSum - vec_AokiScore[indexMap[i]]);
	}
	// console.log("-----------------------");
	console.log(vec_TakahashiScore.join("\n"));
}


Main(require("fs").readFileSync("/dev/stdin", "utf8")); 