#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
signed main() { 
  ios::sync_with_stdio(false); cin.tie(0);
  int n, q;
  cin >> n >> q;
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  vector<long long> sum1(n + 1), sum2(n + 1);
  for (int i = 0; i < n; i++) {
    sum1[i + 1] = sum1[i] + a[i];
    sum2[i + 1] = (i - 1 >= 0 ? sum2[i - 1] : 0LL) + a[i];
  }
  while (q--) {
    long long x;
    cin >> x;
    int lo = 0, hi = n;
    while (hi - lo > 1) {
      int mid = (lo + hi) >> 1;
      if (n - mid - mid + 1 >= 0 && a[n - mid] - x >= x - a[n - mid - mid + 1]) lo = mid;
      else hi = mid;
    }
    cout << sum1[n] - sum1[n - lo] + (n - lo - lo >= 0 ? sum2[n - lo - lo] : 0LL) << '\n';
  }
  return 0;
}