import sys

input = sys.stdin.readline

from bisect import *



def judge(x):

    a = N-x

    b = x-bisect_left(A, X-(A[x]-X))+1

    

    return a<=b



def binary_search():

    l, r = bisect_left(A, X), N-1

    

    while l<=r:

        m = (l+r)//2

        

        if judge(m):

            r = m-1

        else:

            l = m+1

    

    return l



N, Q = list(map(int, input().split()))

A = list(map(int, input().split()))

acc = [0]*(N+1)

eacc = [0]*(N+1)

oacc = [0]*(N+1)



for i in range(N):

    acc[i+1] = acc[i]+A[i]

    

    if i%2==0:

        eacc[i+1] = eacc[i]+A[i]

        oacc[i+1] = oacc[i]

    else:

        eacc[i+1] = eacc[i]

        oacc[i+1] = oacc[i]+A[i]



for _ in range(Q):

    X = int(eval(input()))

    border = binary_search()

    ans = acc[N]-acc[border]

    

    if N-2*(N-border)>=0:

        if (N-2*(N-border))%2==0:

            ans += oacc[N-2*(N-border)]

        else:

            ans += eacc[N-2*(N-border)]

    

    print(ans)
import sys

input = sys.stdin.readline

from bisect import *



def judge(x):

    a = N-x

    b = x-bisect_left(A, X-(A[x]-X))+1

    

    return a<=b



def binary_search():

    l, r = bisect_left(A, X), N-1

    

    while l<=r:

        m = (l+r)//2

        

        if judge(m):

            r = m-1

        else:

            l = m+1

    

    return l



N, Q = list(map(int, input().split()))

A = list(map(int, input().split()))

acc = [0]*(N+1)

eacc = [0]*(N+1)



for i in range(N):

    acc[i+1] = acc[i]+A[i]

    eacc[i+1] = eacc[i]+(A[i] if i%2==0 else 0)



for _ in range(Q):

    X = int(eval(input()))

    border = binary_search()

    ans = acc[N]-acc[border]

    

    if N-2*(N-border)>=0:

        if (N-2*(N-border))%2==0:

            ans += acc[N-2*(N-border)]-eacc[N-2*(N-border)]

        else:

            ans += eacc[N-2*(N-border)]

    

    print(ans)

    
import sys

input = sys.stdin.readline
from bisect import *


def judge(x):
    a = N - x
    b = x - bisect_left(A, X - (A[x] - X)) + 1
    return a <= b


def binary_search():
    l, r = bisect_left(A, X), N - 1
    while l <= r:
        m = (l + r) // 2
        if judge(m):
            r = m - 1
        else:
            l = m + 1
    return l


N, Q = list(map(int, input().split()))
A = list(map(int, input().split()))
acc = [0] * (N + 1)
eacc = [0] * (N + 1)
oacc = [0] * (N + 1)
for i in range(N):
    acc[i + 1] = acc[i] + A[i]
    if i % 2 == 0:
        eacc[i + 1] = eacc[i] + A[i]
        oacc[i + 1] = oacc[i]
    else:
        eacc[i + 1] = eacc[i]
        oacc[i + 1] = oacc[i] + A[i]
for _ in range(Q):
    X = int(eval(input()))
    border = binary_search()
    ans = acc[N] - acc[border]
    if N - 2 * (N - border) >= 0:
        if (N - 2 * (N - border)) % 2 == 0:
            ans += oacc[N - 2 * (N - border)]
        else:
            ans += eacc[N - 2 * (N - border)]
    print(ans)

import sys

input = sys.stdin.readline
from bisect import *


def judge(x):
    a = N - x
    b = x - bisect_left(A, X - (A[x] - X)) + 1
    return a <= b


def binary_search():
    l, r = bisect_left(A, X), N - 1
    while l <= r:
        m = (l + r) // 2
        if judge(m):
            r = m - 1
        else:
            l = m + 1
    return l


N, Q = list(map(int, input().split()))
A = list(map(int, input().split()))
acc = [0] * (N + 1)
eacc = [0] * (N + 1)
for i in range(N):
    acc[i + 1] = acc[i] + A[i]
    eacc[i + 1] = eacc[i] + (A[i] if i % 2 == 0 else 0)
for _ in range(Q):
    X = int(eval(input()))
    border = binary_search()
    ans = acc[N] - acc[border]
    if N - 2 * (N - border) >= 0:
        if (N - 2 * (N - border)) % 2 == 0:
            ans += acc[N - 2 * (N - border)] - eacc[N - 2 * (N - border)]
        else:
            ans += eacc[N - 2 * (N - border)]
    print(ans)

-oacc = [0] * (N + 1) -    if i % 2 == 0: -        eacc[i + 1] = eacc[i] + A[i] -        oacc[i + 1] = oacc[i] -    else: -        eacc[i + 1] = eacc[i] -        oacc[i + 1] = oacc[i] + A[i] +    eacc[i + 1] = eacc[i] + (A[i] if i % 2 == 0 else 0) -            ans += oacc[N - 2 * (N - border)] +            ans += acc[N - 2 * (N - border)] - eacc[N - 2 * (N - border)]