#include <bits/stdc++.h>
 
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef gp_hash_table<long long, long long> umap;
#define fr(i,a,b) for (int i = (a), _b = (b); i <= _b; i++)
#define frr(i,a,b) for (int i = (a), _b = (b); i >= _b; i--)
#define rep(i,n) for (long long i = 0, _n = (n); i < _n; i++)
#define repr(i,n) for (long long i = (n) - 1; i >= 0; i--)
#define foreach(it,ar) for ( typeof(ar.begin()) it = ar.begin(); it != ar.end(); it++ )
#define fill(ar,val) memset(ar, val, sizeof(ar))
#define fill0(ar) fill((ar), 0)
#define fillinf(ar, n) fr(i,0,(n)) ar[i] = INF
#define debug(x) cout<<#x<<": "<<x<<endl
#define arr1d(a,n) cout << #a << " : "; fr(_,1,n) cout << a[_] << ' '; cout << endl;
#define arr1d0(a,n) cout << #a << " : "; rep(_,n) cout << a[_] << ' '; cout << endl;
#define arr2d(a,n,m) cout << #a << " :" << endl; fr(_,1,n) {fr(__,1,m) cout << a[_][__] << ' '; cout << endl;}
#define arr2d0(a,n,m) cout << #a << " :" << endl; rep(_,n) {rep(__,m) cout << a[_][__] << ' '; cout << endl;}
/*Author Ritick Goenka || ritick(codechef) ||ritick(codeforces) */
/*IIT Roorkee = <3 */
#define ull unsigned long long
#define ll long long
#define ld double
#define ui unsigned int
#define all(ar) ar.begin(), ar.end()
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define y0 yyyyyy0
#define y1 yyyyyy1
#define sot(bello) bello.begin(),bello.end()
#define BIT(n) (1<<(n))
#define SQR(x) ((x) * (x))
#define CUBE(x) ((x) * (x) * (x))
#define LSOne(S) (S) & (-S)
inline bool EQ(double a, double b) {return fabs(a - b) < 1e-9;}
 
typedef pair<int, int> ii;
typedef pair<int, ii> iii;
typedef vector<ii> vii;
typedef vector<int> vi;
typedef vector<string> vs;
 
 
template<typename T>inline T gcd(T a, T b){if (b == 0)return a;else return gcd(b, a % b);}
template<typename T>inline T lcm(T a, T b){return (a * b) / gcd(a, b);}
template<typename T> string toStr(T x) {stringstream st; st << x; string s; st >> s; return s;}
template<class T>
void splitStr(const string &s, vector<T> &out)
{
    istringstream in(s);
    out.clear();
    copy(istream_iterator<T>(in), istream_iterator<T>(), back_inserter(out));
}
 
inline int two(int n) {return 1 << n;}
inline int isOnBit(int n, int b) {return (n >> b) & 1;}
inline void onBit(int & n, int b) {n |= two(b);}
inline void offBit(int & n, int b) {n &= ~two(b);}
inline int lastBit(int n) {return n & (-n);}
inline int cntBit(int n) {int res = 0; while(n && ++res) n -= n &(-n); return res;}
 
const int dx4[] = {-1, 0, 1, 0};
const int dy4[] = {0, 1, 0, -1};
const int dx8[] = {-1, 0, 1, 0, -1, -1, 1, 1};
const int dy8[] = {0, 1, 0, -1, -1, 1, -1, 1};
 
#define INP "test.inp"
#define OUT "test.out"
 
#define PI 3.1415926535897932385
#define INF 1000000000000000
#define EPS 1e-7
#define MAXN 100000
#define MOD 1000000007
#define dec decr
//END OF COMPETITVE PROGRAMMING TEMPLATE
ll gcd(ll a, ll b) 
{ 
    if (a == 0) 
        return b; 
    return gcd(b % a, a); 
} 
ll modexp(ll x, ll y, ll p)
{
    ll res = 1;   
    x = x % p;  
    while (y > 0)
    {
        if (y & 1)    
            res = (res*x) % p;
        y = y>>1;     
        x = (x*x) % p; 
    }
    return res;
}
char c[405][405];
int mark[405][405];
pair<ll,ll> dfs(ll i,ll j, ll k)
{
    // debug(i);
    // debug(j);
    mark[i][j]=1;
    ll ans1=0,ans2=0;
    if(k==1)
    {
        if(c[i-1][j]=='#'&&mark[i-1][j]==0)
        {
            pair<ll,ll> kk=dfs(i-1,j,0);
            ans2+=kk.ss;
            ans1+=kk.ff;
        }
        if(c[i+1][j]=='#'&&mark[i+1][j]==0)
        {
            pair<ll,ll> kk=dfs(i+1,j,0);
            ans2+=kk.ss;
            ans1+=kk.ff;
        }
        if(c[i][j-1]=='#'&&mark[i][j-1]==0)
        {
            pair<ll,ll> kk=dfs(i,j-1,0);
            ans2+=kk.ss;
            ans1+=kk.ff;
        }
        if(c[i][j+1]=='#'&&mark[i][1+j]==0)
        {
            pair<ll,ll> kk=dfs(i,j+1,0);
            ans2+=kk.ss;
            ans1+=kk.ff;
        }
        return mp(ans1,ans2+1);
    }
    else
    {
        if(c[i-1][j]=='.'&&mark[i-1][j]==0)
        {
            pair<ll,ll> kk=dfs(i-1,j,1);
            ans2+=kk.ss;
            ans1+=kk.ff;
        }
        if(c[i+1][j]=='.'&&mark[i+1][j]==0)
        {
            pair<ll,ll> kk=dfs(i+1,j,1);
            ans2+=kk.ss;
            ans1+=kk.ff;
        }
        if(c[i][j-1]=='.'&&mark[i][j-1]==0)
        {
            pair<ll,ll> kk=dfs(i,j-1,1);
            ans2+=kk.ss;
            ans1+=kk.ff;
        }
        if(c[i][j+1]=='.'&&mark[i][1+j]==0)
        {
            pair<ll,ll> kk=dfs(i,j+1,1);
            ans2+=kk.ss;
            ans1+=kk.ff;
        }
        return mp(ans1+1,ans2);
    }
}
ll ar[100005][2];
vector<pair<ll,ll> >v,v1;
int main () 
{
    ios_base::sync_with_stdio(false);
            cin.tie(NULL);
        cout<<setprecision(11);
        ll n,q;
        cin>>n>>q;
        ll a[n],p[n];
        rep(i,n)
        {
            cin>>a[i];
            if(i>0)
                p[i]=p[i-1]+a[i];
            else
                p[i]=a[i];
            if(i>1)
            ar[i][0]=ar[i-1][1]+a[i];
            else
            ar[i][0]=a[i];
            if(i>0)
                ar[i][1]=ar[i-1][0];
            // debug(ar[i][0]);
            // debug(ar[i][1]);
        }
        v.pb(mp(INF,ar[n-1][0]));
        for(ll i=2;i<=(n+1)/2;i++)
        {
            ll kk=max(n-2*i+1,0ll);
            ll k=a[n-i]+a[kk];
            k/=2;
            // debug(k);
            ll ans=p[n-1]-p[n-1-i];
            // debug(ans);
            ans+=ar[n-1-2*i][0];
            // debug(ar[n-1-2*i][0]);
            // debug(ans);
            v.pb(mp(k,ans));
        }
        
        // debug("Df");
        reverse(all(v));
        ll ans=p[n-1]-p[n-1-(n+1)/2];
        rep(i,q)
        {
            ll x;
            cin>>x;
            v1.pb(mp(x,i));
        }
        sort(all(v1));
        ll an[q]={0};
        ll j=0;
        // debug(ans);
        rep(i,q)
        {
            // debug(v1[i].ff);
            // debug(v[])
            while(v1[i].ff>v[j].ff)
            {
                ans=v[j+1].ss;
                j++;
            }
            an[v1[i].ss]=ans;
        }
        rep(i,  q)
        {
            cout<<an[i]<<endl;
        }
        return 0;
}

Measured memory_bytes: 8048