#include <bits/stdc++.h>
using namespace std;
using ll = long long;

int main()
{
	int N, Q;
	cin >> N >> Q;
	vector<ll> A(N), sum(N + 1), sum2(N + 1);
	for (int i = 0; i < N; i++) {
		cin >> A[i];
		sum[i + 1] = sum[i] + A[i];
		sum2[i + 1] = (i ? sum2[i - 1] : 0) + A[i];
	}
	while (Q--) {
		ll X;
		cin >> X;
		int lb = 0, ub = N + 1;
		while (ub - lb > 1) {
			int t = (lb + ub) >> 1;
			if (abs(A[N - (t + 1) / 2] - X) < abs(A[N - t] - X)) {
				ub = t;
			}
			else {
				lb = t;
			}
		}
		cout << sum2[max(N - lb - (lb & 1), 0)] + (sum[N] - sum[N - (lb + 1) / 2]) << endl;
	}
	return 0;
}
