// includes {{{
#include<iostream>
#include<iomanip>
#include<algorithm>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<tuple>
#include<cmath>
#include<random>
#include<cassert>
// #include<deque>
// #include<multiset>
// #include<bitset>
// #include<cstring>
// #include<bits/stdc++.h>
// }}}
using namespace std;
using ll = long long;


// #undef DEBUG
// #define DEBUG
// DEBUG {{{
#include <array>
#include <deque>
#include <iostream>
#include <list>
#include <queue>
#include <stack>
#include <tuple>
#include <valarray>
#include <vector>
// clang-format off
template<int n, class...T> typename enable_if<(n>=sizeof...(T))>::type _ot(ostream &, tuple<T...> const &){}
template<int n, class...T> typename enable_if<(n< sizeof...(T))>::type _ot(ostream & os, tuple<T...> const & t){ os << (n==0?"":", ") << get<n>(t); _ot<n+1>(os, t); }
template<class...T> ostream & operator<<(ostream &o, tuple<T...> const &t){ o << "("; _ot<0>(o, t); o << ")"; return o; }
template<class T, class U> ostream & operator<<(ostream &o, pair<T, U> const &p) { o << "(" << p.first << ", " << p.second << ")"; return o; }
template < class T > ostream &operator<<(ostream &o, const stack<T> &a) { o << "{"; for(auto tmp = a; tmp.size(); tmp.pop()) o << (a.size() == tmp.size() ? "" : ", ") << tmp.top(); o << "}"; return o; }
template <class T, class Container, class Compare > ostream &operator<<(ostream &os, priority_queue<T, Container, Compare> a) { os << "{ (top) "; while(a.size()) os << a.top() << (a.size() == 1 ? "" : ", "), a.pop(); os << " }"; return os; }
template <class T, class Container > ostream &operator<<(ostream &os, queue<T, Container> a) { os << "{ "; while(a.size()) os << a.front() << (a.size() == 1 ? "" : ", "), a.pop(); os << " }"; return os; }
#ifdef DEBUG
#if !defined(DEBUG_OUT)
#define DEBUG_OUT cerr
#endif
#if !defined(DEBUG_LEFT)
#define DEBUG_LEFT "\e[1;36m"
#endif
#if !defined(DEBUG_RIGHT)
#define DEBUG_RIGHT ":\e[m"
#endif
#define dump(...) [&](){auto __debug_tap=make_tuple(__VA_ARGS__);DEBUG_OUT<<DEBUG_LEFT<<__LINE__ << DEBUG_RIGHT << " " <<#__VA_ARGS__<<" = "<<__debug_tap<<endl;}()
template < class T > inline void dump2D(T &d, size_t sizey, size_t sizex) { for(size_t i = 0; i < sizey; i++) { DEBUG_OUT << "\t"; for(size_t j = 0; j < sizex; j++) DEBUG_OUT << d[i][j] << (j + 1 == sizex ? "" : "\t"); DEBUG_OUT << endl; } }
template < class T > inline void dump1D(T &d, size_t sizey) { for(size_t i = 0; i < sizey; i++) { DEBUG_OUT << d[i] << (i + 1 == sizey ? "" : " "); } DEBUG_OUT << endl; }
template < class T, class = typename iterator_traits< decltype(begin(T())) >::value_type, class = typename enable_if<!is_same<T, string>::value>::type > ostream &operator<<(ostream &o, const T &a) { o << "{"; for(auto ite = begin(a); ite != end(a); ++ite) o << (ite == begin(a) ? "" : ", ") << *ite; o << "}"; return o; }
#else
#define dump(...) (42)
#define dump2D(...) (42)
#define dump1D(...) (42)
template < class T, class = typename iterator_traits< decltype(begin(T())) >::value_type, class = typename enable_if<!is_same<T, string>::value>::type > ostream &operator<<(ostream &o, const T &a) { for(auto ite = begin(a); ite != end(a); ++ite) o << (ite == begin(a) ? "" : " ") << *ite; return o; }
#endif
// clang-format on
// }}}


int n, q;
const int N = 1e5;
int x;
int a[N];
int last = 0;

// k回を行えるか
bool check(int k) {
  int pnear = k / 2;
  int pmax = k - pnear;
  int p = lower_bound(a, a + n, x) - a;
  // dump(p);
  int ng = -1, ok = n - p;
  int rest = (n - p) - pmax;
  if(rest < 0) return 0;
  while(abs(ok - ng) > 1) {
    int mid = (ok + ng) >> 1;
    int range = a[p + mid] - x;
    int q = lower_bound(a, a + n, x - range) - a;
    int left = p - q;
    // mid + left個食う
    if(left + mid >= pnear) ok = mid; else ng = mid;
  }
  // near は右 ok 個だけ食えばいい
  if(ok <= rest) {
    return 1;
  }
  return 0;
}

ll suma[2][N];

ll rang2(int i, int l, int r) {
  if(l < 0) l = 0;
  if(l > r) return 0;
  ll res = suma[i][r];
  if(l-1 >= 0) res -= suma[i][l-1];
  return res;
}
ll rang(int l, int r) {
  return rang2(0, l, r) + rang2(1, l, r);
}


int main() {
  ios::sync_with_stdio(false), cin.tie(0);
  cin >> n >> q;
  for(int i = 0; i < n; i++) cin >> a[i];
  for(int i = 0; i < n; i++) suma[i%2][i] = a[i];
  for(int i = 1; i < n; i++) suma[0][i] += suma[0][i-1], suma[1][i] += suma[1][i-1];

  for(int i = 0; i < q; i++) {
    cin >> x;
    int ng = n + 1, ok = 0;
    // 何ターンで不規則になるか
    while(abs(ng - ok) > 1) {
      int mid = (ok + ng) >> 1;
      // dump(mid);
      if(check(mid)) ok = mid; else ng = mid;
    }
    // dump(ok);
    int c = (ok + 1)/2;
    ll ans = 0;
    ans += rang(n - 1 - c + 1, n - 1);
    // n - k - 1 から食べ始める (k % 2) が
    ans += rang2(((n - ok - 1) & 1) ^ (ok % 2), 0, n - ok - 1);
    cout << ans << "\n";
  }
  return 0;
}


Measured memory_bytes: 3712