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

void main() {
    auto s = readln.split.map!(to!int);
    auto N = s[0];
    auto Q = s[1];
    auto A = readln.split.map!(to!long).array;
    auto X = Q.iota.map!(_ => readln.chomp.to!long).array;

    auto B = new long[](N+1);
    foreach (i; 0..N) B[i+1] = B[i] + A[i];
    auto AA = [A.dup, A.dup];
    auto BB = new long[][](2, N+1);
    foreach (k; 0..2) foreach (i; iota(1-k, N, 2)) AA[k][i] = 0;
    foreach (k; 0..2) foreach (i; 0..N) BB[k][i+1] = BB[k][i] + AA[k][i];

    foreach (x; X) {
        if (x <= A.front) {
            writeln(B[N] - B[N/2]);
            continue;
        }
        if (x >= A.back) {
            writeln(BB[1-N%2][N]);
            continue;
        }

        int hi = N;
        int lo = 0;
        while (hi - lo > 1) {
            int mid = (hi + lo) / 2;
            int r = N - mid - 1;
            int l = r - mid + 1;
            if (l < 0 || (l > 0 && abs(x - A[r]) >= abs(x - A[l-1])) || (r < N - 1 && abs(x - A[r+1]) < abs(x - A[r]))) {
                hi = mid;
            } else {
                lo = mid;
            }
        }

        if (lo == 0) {
            writeln(B[N] - B[N/2]);
            continue;
        }

        int r = N - lo - 1;
        int l = r - lo + 1;
        long ans = B[N] - B[r+1] + BB[1-l%2][l];
        ans.writeln;
    }
}
