#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
	cin.tie(0);
	ios_base::sync_with_stdio(false);
	int N, Q;
	cin >> N >> Q;
	vector<long long> A(N);
	for (int i = 0; i < N; ++i) cin >> A[i], A[i] *= 3;
	vector<long long> S(N + 1), chrosum(N + 1);
	for (int i = 0; i < N; ++i) {
		S[i + 1] = S[i] + A[i];
		chrosum[i + 1] = chrosum[i] + (i % 2 != N % 2 ? A[i] : 0);
	}
	for (int i = 0; i < Q; ++i) {
		long long X;
		cin >> X; X = 3 * X - 1;
		long long L = 0, R = 3000000000;
		while (R - L > 1) {
			long long M = (L + R) >> 1;
			int div1 = lower_bound(A.begin(), A.end(), X - M) - A.begin();
			int div2 = lower_bound(A.begin(), A.end(), X + M + 1) - A.begin();
			if (div2 - div1 > N - div2) R = M;
			else L = M;
		}
		int fdiv1 = lower_bound(A.begin(), A.end(), X - L) - A.begin();
		int fdiv2 = lower_bound(A.begin(), A.end(), X + L + 1) - A.begin();
		long long ans = (S[N] - S[fdiv2]) + chrosum[fdiv1];
		cout << ans / 3 << '\n';
	}
	return 0;
}