output_description: Print Q lines. The i-th line (1 \leq i \leq Q) should contain the answer for x
  = X_i.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N Q
      A_1 A_2 ... A_N
      X_1
      X_2
      :
      X_Q
attempt: //header
  #define set_header 1
  #ifdef set_header
      #include <bits/stdc++.h>
      #ifdef LOCAL
          #include "cxx-prettyprint-master/prettyprint.hpp"
          #define print(x) cout << x << endl
      #else
          #define print(...) 42
      #endif
      using namespace std;
      using ll = long long;
      #define INF 1'010'000'000'000'000'017LL
      #define mod 998244353LL
      #define eps 0.0001
      #define all(x) (x).begin(), (x).end()
      #define reverse(x) (x).rbegin(), (x).rend()
      #define FOR(i,a,b) for(ll i=(a);i<(b);++i)
      #define rep(i,n)  FOR(i,0,n)
      #define SZ(x) ((ll)(x).size())
      #define sum(x) accumulate(ALL(x), 0LL)//?
      #define pb(x) push_back(x)
      typedef pair < ll , ll >P;
      ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
      template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
      template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
      template <std::uint_fast64_t Modulus> class modint {
          using u64 = std::uint_fast64_t;
  
          public:
          u64 a;
  
          constexpr modint(const u64 x = 0) noexcept : a(x % Modulus) {}
          constexpr u64 &value() noexcept { return a; }
          constexpr const u64 &value() const noexcept { return a; }
          constexpr modint operator+(const modint rhs) const noexcept {
              return modint(*this) += rhs;
          }
          constexpr modint operator-(const modint rhs) const noexcept {
              return modint(*this) -= rhs;
          }
          constexpr modint operator*(const modint rhs) const noexcept {
              return modint(*this) *= rhs;
          }
          constexpr modint operator/(const modint rhs) const noexcept {
              return modint(*this) /= rhs;
          }
          constexpr modint &operator+=(const modint rhs) noexcept {
              a += rhs.a;
              if (a >= Modulus) {
              a -= Modulus;
              }
              return *this;
          }
          constexpr modint &operator-=(const modint rhs) noexcept {
              if (a < rhs.a) {
              a += Modulus;
              }
              a -= rhs.a;
              return *this;
          }
          constexpr modint &operator*=(const modint rhs) noexcept {
              a = a * rhs.a % Modulus;
              return *this;
          }
          constexpr modint &operator/=(modint rhs) noexcept {
              u64 exp = Modulus - 2;
              while (exp) {
              if (exp % 2) {
                  *this *= rhs;
              }
              rhs *= rhs;
              exp /= 2;
              }
              return *this;
          }
          };
      template< typename T >
      T mod_pow(T x, T n, const T &p) {
          T ret = 1;
          while(n > 0) {
              if(n & 1) (ret *= x) %= p;
              (x *= x) %= p;
              n >>= 1;
          }
          return ret;
      }
      class range {private: struct I{int x;int operator*(){return x;}bool operator!=(I& lhs){return x<lhs.x;}void operator++(){++x;}};I i,n;
      public:range(int n):i({0}),n({n}){}range(int i,int n):i({i}),n({n}){}I& begin(){return i;}I& end(){return n;}};
      uint64_t my_rand(void) {
  	static uint64_t x = 88172645463325252ULL;
  	x = x ^ (x << 13); x = x ^ (x >> 7);
  	return x = x ^ (x << 17);
  }
  #endif
  //library
  int N;
  vector<ll> A;
  bool C(ll x, ll y){
      int r = distance(begin(A), upper_bound(all(A), y));
      int l = distance(begin(A), lower_bound(all(A), x*2-y));
      if(N-r >= r-l) return true;
      return false;
  }
  //main
  int main() {
      int Q;
      cin >> N >> Q;
      A.resize(N);
      vector<ll> S(N+1), S0(N+1), S1(N+1);
      rep(i, N){
          cin >> A[i];
          S[i+1] = S[i]+A[i];
          if(i%2 == 0){
              S0[i+1] = S0[i]+A[i];
              S1[i+1] = S1[i];
          }else{
              S1[i+1] = S1[i]+A[i];
              S0[i+1] = S0[i];
          }
      }
      rep(i, Q){
          ll x;
          cin >> x;
          ll ok = x, ng = A[N-1];
          while((ng-ok)>1){
              ll mid = (ok+ng)/2;
              if(C(x, mid))ok = mid;
              else ng = mid;
          }
          ll y = ok;
          int r = distance(begin(A), upper_bound(all(A), y));
          int l = distance(begin(A), upper_bound(all(A), x*2-y));
          if(N-r-(r-l) > 1)l--;
          ll taka = S[N]-S[r];
          if(N-r-(r-l) == l%2)taka+=S1[l];
          else taka+=S0[l];
          cout << taka << endl;
      }
  
  }
problem_description: Statement
  
  There are N cards. The i-th card has an integer A_i written on it. For any two
  cards, the integers on those cards are different.
  
  Using these cards, Takahashi and Aoki will play the following game:
  
    * Aoki chooses an integer x.
    * Starting from Takahashi, the two players alternately take a card. The card should be chosen in the following manner:
      * Takahashi should take the card with the largest integer among the remaining card.
      * Aoki should take the card with the integer closest to x among the remaining card. If there are multiple such cards, he should take the card with the smallest integer among those cards.
    * The game ends when there is no card remaining.
  
  You are given Q candidates for the value of x: X_1, X_2, ..., X_Q. For each i
  (1 \leq i \leq Q), find the sum of the integers written on the cards that
  Takahashi will take if Aoki chooses x = X_i.
samples: [{"input": "5 5\n    3 5 7 11 13\n    1\n    4\n    9\n    10\n    13", "output": "31\n    31\n    27\n    23\n    23\n    \n\nFor example, when x = X_3(= 9), the game proceeds as follows:\n\n  * Takahashi takes the card with 13.\n  * Aoki takes the card with 7.\n  * Takahashi takes the card with 11.\n  * Aoki takes the card with 5.\n  * Takahashi takes the card with 3.\n\nThus, 13 + 11 + 3 = 27 should be printed on the third line.\n\n* * *"}, {"input": "4 3\n    10 20 30 40\n    2\n    34\n    34", "output": "70\n    60\n    60"}]