#include <iostream>
using namespace std;
typedef long long ll;
ll n,q,t[100001],u[100001],a[100000],x;
int main(void){
  cin>>n>>q;
  for(int i=0;i<n;i++){
    cin>>a[i];
    t[i+1]=t[i]+a[i];
    u[i+1]=(i?u[i-1]:0)+a[i];
  }
  while(q--){
    cin>>x;
    ll ub=0,lb=n+1,m;
    while(ub+1<lb){
      m=(lb+ub)/2;
      if(abs(a[n-m]-x)>abs(a[n-(m+1)/2]-x))lb=m;
      else ub=m;
    }
cout<<t[n]-t[n-(ub+1)/2]+u[max(n-ub-(ub&1),0LL)]<<endl;
  }
}