#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <sstream>
#include <set>
#include <map>
#include <iostream>
#include <utility>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <unordered_set>
#include <unordered_map>
#include <limits.h>
#include <cstring>
#include <tuple>
#include <cassert>
#include <numeric>
#include <iomanip>
using namespace std;
// type alias
typedef long long LL;
typedef pair< int , int > II;
typedef tuple< int, int, int > III;
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<vector<int>> VVI;
typedef unordered_map<int,int> MAPII;
typedef unordered_set<int> SETI;
template<class T> using VV=vector<vector<T>>;
// minmax
template<class T> inline T SMIN(T& a, const T b) { return a=(a>b)?b:a; }
template<class T> inline T SMAX(T& a, const T b) { return a=(a<b)?b:a; }
// repetition
#define FORE(i,a,b) for(int i=(a);i<=(b);++i)
#define REPE(i,n)  for(int i=0;i<=(n);++i)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  for(int i=0;i<(n);++i)
#define FORR(x,arr) for(auto& x:arr)
#define SZ(a) int((a).size())
// collection
#define ALL(c) (c).begin(),(c).end()
// DP
#define MINUS(dp) memset(dp, -1, sizeof(dp))
#define ZERO(dp) memset(dp, 0, sizeof(dp))

// stdout
#define println(args...) fprintf(stdout, ##args),putchar('\n');

// debug cerr
#define TRACE true
#define dump(x) if(TRACE) { cerr << #x << " = " << (x) << endl; }
#define dump2(x,y) if(TRACE) { cerr << #x << " = " << (x) << ", " << #y << " = " << (y) << endl; }
#define dump3(x,y,z) if(TRACE) { cerr << #x << " = " << (x) << ", " << #y << " = " << (y) << ", " << #z << " = " << (z) << endl; }
#define dump4(x,y,z,a) if(TRACE) { cerr << #x << " = " << (x) << ", " << #y << " = " << (y) << ", " << #z << " = " << (z) << ", " << #a << " = " << (a) << endl; }
#define dumpf(args...) if(TRACE) { fprintf(stderr, ##args); putchar('\n'); }
#define dumpAR(ar) if(TRACE) { FORR(x,(ar)) { cerr << x << ','; } cerr << endl; }
template<class Iter> void dumpc(Iter begin, Iter end) { if (TRACE) { for(; begin!=end; ++begin) { cerr<<*begin<<','; } cerr<<endl; } }

// $ cp-batch NearestCardGame | diff NearestCardGame.out -
// $ g++ -std=c++14 -Wall -O2 -D_GLIBCXX_DEBUG -fsanitize=address NearestCardGame.cpp && ./a.out

/*
 
 1/17/2019
 
 16:54-18:16 WA
 18:30 give up
 
 22:10- read submit solutions
 
 DO NOT binary search by `radius`.
 It's confusing to resolve tie of distance with `x`.
 It's possible to binary search by # of elements that Takahashi takes.
 Aoki should take the same number. We can check validity.
 
 Condition of the validity is complex. I couldn't clearly define it.
 
 Solution with radius binary search by @sugim48
  - https://atcoder.jp/contests/aising2019/submissions/3987556
 
 */

const int MAX_N=1e6+10;
LL A[MAX_N];
int N,Q;

LL cum[MAX_N];
LL cum2[MAX_N];
void prep() {
  cum[0]=0,cum2[0]=cum2[1]=0;
  REP(i,N) {
    cum[i+1]=cum[i]+A[i];
    cum2[i+2]=cum2[i]+A[i];
  }
}

LL solve(int x) {
  LL good=0,bad=N+1;
  while(abs(good-bad)>1) {
    LL mid=(good+bad)/2;
    if(N-(2*mid-1)<0) bad=mid; else {
      LL d1=x-A[N-(2*mid-1)],d2=A[N-mid]-x;
//      dump2(mid,d1<=d2);
      (d1<=d2?good:bad)=mid;
    }
  }
  int r=N-good,l=N-(2*good-1);
  LL res=cum[N]-cum[r];
//  dump4(x,good,l,r);
//  dump(N-(2*good-1));
  assert(l>=0);
  res+=cum2[l];
  return res;
}

II f(LL rad, int x) {
  int l=lower_bound(A,A+N,x-rad)-A;
  int r=upper_bound(A,A+N,x+rad)-A;
  /*
  int tcnt=N-(r+1),acnt=r-l+1;
//  if(rad==2) dump4(l,r,tcnt,acnt);
  if(tcnt>=acnt) return {l,r};
  if(acnt==tcnt+1) return {l-1,r-1};
  return {-10,-10};
   */
  int d=r-l;
  if(r<=N-d) return {l,r};
  return {-10,-10};
}

LL solve_wrong(int x) {
  LL good=0,bad=1e10;
  LL l=N,r=N;
  while(abs(good-bad)>1) {
    LL m=(good+bad)/2;
    II p=f(m,x);
//    dump3(m,p.first,p.second);
    
    if(p.first<-1) bad=m;
    else good=m,l=p.first,r=p.second;
  }
  dump2(l,r);
//  LL res=cum[N];
//  if(r+1>=0&&r+1<=N)res-=cum[r];
//  if(l+1>=0)res+=cum2[l-1+2];
  LL res=cum[N]-cum[r];
  if((N-l)%2) --l;
  if(l>=0) res+=cum2[l];
  return res;
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout<<setprecision(12)<<fixed;
  
  cin>>N>>Q;
  REP(i,N) cin>>A[i];
  prep();
  REP(i,Q) {
    int x; cin>>x;
    cout<<solve(x)<<endl;
  }
  
  return 0;
}


Measured memory_bytes: 10752