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 inf = 1_001_001_001;
enum infl = 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!(int[]).sort();
    auto x = iota(q).map!(i => readln.chomp.to!int).array;

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

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

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

    foreach (xi ; x) {
        int ok = 1, ng = n + 1;

        while (abs(ok - ng) > 1) {
            int mid = (ok + ng) / 2;
            if (check(xi, mid)) {
                ok = mid;
            }
            else {
                ng = mid;
            }
        }

        int k = ok;
        auto r = max(0, n - 2*k);

        long ans = usiro[k] + kogo[r];
        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);
        }
    }
}

bool chmin(T, U...)(ref T x, U args) {
    bool isChanged;

    foreach (arg ; args) {
        if (x > arg) {
            x = arg;
            isChanged = true;
        }
    }

    return isChanged;
}

bool chmax(T, U...)(ref T x, U args) {
    bool isChanged;

    foreach (arg ; args) {
        if (x < arg) {
            x = arg;
            isChanged = true;
        }
    }

    return isChanged;
}

long powmod(long x, long y, long mod = 1_000_000_007L) {
    long res = 1L;

    while (y > 0) {
        if (y & 1) {
            (res *= x) %= mod;
        }
        (x *= x) %= mod;
        y >>= 1;
    }

    return res;
}