#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vec;
typedef vector<vec> mat;
typedef pair<ll,ll> pll;
const ll mod=1e9+7;
//const ll mod=998244353;
const ll inf=1LL<<61;

int main() {
  ll n,q;
  cin >> n >> q;
  vec a(n),sum(n+1),sum2(n+1);
  for(ll 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];
  }
  vec x(q);
  for(ll i=0;i<q;i++) cin >> x[i];
  for(ll i=0;i<q;i++) {
    ll lb=0,ub=n+1;
    while(ub-lb>1) {
      ll t=(lb+ub)>>1;
      if(abs(a[n-(t+1)/2]-x[i])>=abs(a[n-t]-x[i])) {
        lb=t;
      }
      else {
        ub=t;
      }
    }
    cout << sum2[max(n-lb-(lb&1),0LL)]+(sum[n]-sum[n-(lb+1)/2]) << endl;
  }
}