#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <climits>
#include <cstring>

#define rep(i, m, n) for(int i=int(m);i<int(n);i++)
#define all(c) begin(c),end(c)

template<typename T1, typename T2>
inline void chmin(T1 &a, T2 b) { if (a > b) a = b; }

template<typename T1, typename T2>
inline void chmax(T1 &a, T2 b) { if (a < b) a = b; }

//改造
typedef long long int ll;
using ll = long long int;
using ull = long long unsigned int;
using Int = long long int;
using namespace std;
#define INF (1 << 30) - 1
#define INFl (ll)5e15
#define DEBUG 0 //デバッグする時1にしてね
#define dump(x)  cerr << #x << " = " << (x) << endl
#define MOD 1000000007


//ここから編集する
class Solve {
public:
    Int N, Q;
    vector<Int> A;

    vector<Int> rui;
    vector<Int> odd_rui;
    vector<Int> even_rui;

    Int aokiR(Int x) {
        //upper_bound(x) - 1を0としておく
        Int lb = upper_bound(all(A), x) - A.begin() - 1;
        Int ub = N;
        while (ub - lb > 1) {
            Int mid = (lb + ub) / 2;
            // midを取るのは何ターン目?
            Int val_m = A[mid];

            Int lval = x - (A[mid] - x);
            Int lpt = lower_bound(all(A), lval) - A.begin();

            Int turn = mid - lpt + 1;

            if (mid < N - turn) {
                lb = mid;
            } else {
                ub = mid;
            }
        }
        if (lb == N - 1) {
            return lb - 1;
        }

        return lb;
    }


    Int aokiL(Int x) {
        Int ub = upper_bound(all(A), x) - A.begin();
        Int lb = -1;

        while (ub - lb > 1) {
            Int mid = (lb + ub) / 2;
            Int val_m = A[mid];

            Int rval = x + (x - A[mid]);
            Int rpt = lower_bound(all(A), rval) - A.begin() - 1;

            Int turn = rpt - mid + 1;
            if (rpt < N - turn) {
                ub = mid;
            } else {
                lb = mid;
            }
        }

        return ub;
    }


    Int query(Int x) {
        Int aL = aokiL(x);
        Int aR = aokiR(x);
        Int ans;
        if (aL > aR) {
            if ((N - 1) % 2 == 0) {
                ans = even_rui[N - 1];
            } else {
                ans = odd_rui[N - 1];
            }
            return ans;
        }

        Int tL = aR + 1;
        Int tR = N - 1;
        aL = aR - (tR - tL + 1) + 1;

        ans = rui[tR];
        if (aR >= 0) ans -= rui[aR];

        if ((aL - 1) >= 0) {
            if ((aL - 1) % 2 == 0) {
                ans += even_rui[aL - 1];
            } else {
                ans += odd_rui[aL - 1];
            }
        }

        return ans;
    }

    void solve() {
        cin >> N >> Q;
        A.resize(N);
        rui.resize(N);
        odd_rui.resize(N);
        even_rui.resize(N);

        vector<Int> X(Q);
        for (int i = 0; i < N; ++i) {
            cin >> A[i];
            if (i == 0) {
                rui[i] = A[i];
                even_rui[i] = A[i];
            } else if (i == 1) {
                rui[i] = rui[i - 1] + A[i];
                odd_rui[i] = A[i];
            } else if (i % 2 == 0) {
                rui[i] = rui[i - 1] + A[i];
                even_rui[i] = even_rui[i - 2] + A[i];
            } else {
                rui[i] = rui[i - 1] + A[i];
                odd_rui[i] = odd_rui[i - 2] + A[i];
            }
        }


        for (int i = 0; i < Q; ++i) {
            cin >> X[i];
        }

        for (auto x : X) {
            Int ans = query(x);
            cout << ans << endl;
        }
    }
};


int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);

    Solve().solve();


    return 0;
}


Measured memory_bytes: 5760