import std.stdio, std.string, std.conv;
import std.range, std.algorithm, std.array, std.typecons, std.container;
import std.math, std.numeric, core.bitop;

enum inf3 = 1_001_001_001;
enum inf6 = 1_001_001_001_001_001_001L;
enum mod = 1_000_000_007L;


void main() {
    int n, q;
    scan(n, q);
    auto a = readln.split.to!(long[]);
    auto x = iota(q).map!(i => readln.chomp.to!long).array;

    auto suf = new long[](n + 1);
    foreach (i ; 1 .. n + 1) {
        suf[i] = suf[i - 1] + a[n - i];
    }

    auto alt = new long[](n + 1);
    alt[1] = a[0];
    foreach (i ; 2 .. n + 1) {
        alt[i] = alt[i - 2] + a[i - 1];
    }

    bool check(int k, long x) {
        if (k == 1) {
            return true;
        }
        if (n - 2*k + 1 < 0) {
            return false;
        }
        if (a[n - k] <= x) {
            return false;
        }

        long d = a[n - k] - x;

        return a[n - 2*k + 1] >= x - d;
    }

    long solve(long x) {
        int ok = 1, ng = n + 1;

        while (abs(ok - ng) > 1) {
            int mid = (ok + ng) / 2;
            (check(mid, x) ? ok : ng) = mid;
        }

        int k = ok;
        long ans = suf[k];
        if (n - 2*k >= 0) ans += alt[n - 2*k];

        return ans;
    }

    foreach (i ; 0 .. q) {
        long ans = solve(x[i]);
        writeln(ans);
    }
}






void scan(T...)(ref T args) {
    import std.stdio : readln;
    import std.algorithm : splitter;
    import std.conv : to;
    import std.range.primitives;

    auto line = readln().splitter();
    foreach (ref arg; args) {
        arg = line.front.to!(typeof(arg));
        line.popFront();
    }
    assert(line.empty);
}

void fillAll(R, T)(ref R arr, T value) {
    static if (is(typeof(arr[] = value))) {
        arr[] = value;
    }
    else {
        foreach (ref e; arr) {
            fillAll(e, value);
        }
    }
}
