#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <cstring>
#include <vector>
#include <iostream>
#include <queue>
#include <unordered_map>
#include <cmath>
#include <queue>
#include <string>
#include <random>

using namespace std;
typedef long long ll;
const int maxn = 100005;

int n, m, a[maxn];
ll f[3][maxn];

int l1, r1;

void bs2(int x, int xpos, int limit) {
  l1 = r1 = -1;
  int l = 0, r = xpos;
  while (l <= r) {
    int m = (l + r) >> 1;
    if (x - a[m] <= limit) {
      l1 = m;
      r = m - 1;
    } else l = m + 1;
  }
  l = xpos + 1, r = n - 1;
  while (l <= r) {
    int m = (l + r) >> 1;
    if (a[m] - x <= limit) {
      r1 = m;
      l = m + 1;
    } else r = m - 1;
  }
  if (l1 == -1) {
    if (r1 != -1)l1 = xpos + 1;
  } else {
    if (r1 == -1)r1 = xpos;
  }
  if(l1==-1)l1=r1=xpos;
}

void bs(int x) {
  int l = 0, r = n - 1, xpos = 0;
  while (l <= r) {
    int m = (l + r) >> 1;
    if (a[m] <= x) {
      xpos = m;
      l = m + 1;
    } else {
      r = m - 1;
    }
  }
  int limit = -1;
  l = 0, r = max(x - a[0], a[n - 1] - x);
  while (l <= r) {
    int m = (l + r) >> 1;
    bs2(x, xpos, m);
    //cout<<"find lr:"<<m<<","<<l1<<","<<r1<<endl;
    if (l1 == -1 || (r1 - l1 + 1 > n - 1 - r1)) {
      r = m - 1;
    } else {
      limit = m;
      l = m + 1;
    }
  }
  if (limit != -1)
    bs2(x, xpos, limit);
  else l1 = r1 = xpos;
}

bool g[maxn];

ll bf(int x) {
  memset(g, 0, sizeof(g));
  ll ret = 0;
  while (1) {
    int tmp = -1;
    for (int i = n - 1; i >= 0; i--) {
      if (!g[i]) {
        tmp = a[i];
        g[i] = 1;
       // cout<<"debug: "<<a[i]<<endl;
        break;
      }
    }
    if (tmp == -1)break;
    ret += tmp;
    int mi = -1, idx;
    for (int i = 0; i < n; i++) {
      if (g[i])continue;
      if (mi == -1 || abs(x - a[i]) < mi) {
        mi = abs(x - a[i]);
        idx = i;
      }
    }
    if (idx != -1) {
      g[idx] = 1;
    }
  }
  return ret;
}

void gen(){
  std::random_device rd;  //Will be used to obtain a seed for the random number engine
  std::mt19937 gen(rd()); //Standard mersenne_twister_engine seeded with rd()
  std::uniform_int_distribution<> dis(1, 100000);
  int n = 1000, m = 1000;
  cout<<n<<" "<<m<<endl;
  for(int i=0;i<n;i++){
    while(1) {
      a[i] = dis(gen);
      bool flag = 0;
      for(int j=0;j<i;j++)
        if(a[j]==a[i]){
          flag=1;
          break;
        }
      if(!flag)break;
    }
  }
  sort(a, a + n);
  for(int i=0;i<n;i++)
    cout<<a[i]<<endl;
  for(int i=0;i<m;i++){
    int x=dis(gen);
    cout<<x<<endl;
  }
}

int main() {
#ifdef suiyuan2009
  freopen("/Users/suiyuan2009/CLionProjects/icpc/input.txt", "r", stdin);
  /*freopen("/Users/suiyuan2009/CLionProjects/icpc/input.txt", "w", stdout);
  gen();
  return 0;*/
#endif

  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    f[2][i] = a[i] + (i - 1 < 0 ? 0 : f[2][i - 1]);
    if (i & 1) {
      f[1][i] = a[i] + (i - 2 < 0 ? 0 : f[1][i - 2]);
      if (i)f[0][i] = f[0][i - 1];
    } else {
      f[0][i] = a[i] + (i - 2 < 0 ? 0 : f[0][i - 2]);
      if (i)f[1][i] = f[1][i - 1];
    }
  }
  while (m--) {
    int x;
    ll ret;
    scanf("%d", &x);
    if (x <= a[0]) {
      ret = f[2][n - 1] - f[2][(n >> 1) - 1];
    } else if (x >= a[n - 1]) {
      if ((n - 1) & 1)ret = f[1][n - 1];
      else ret = f[0][n - 1];
    } else {
      bs(x);
      //cout<<"range:"<<l1<<" "<<r1<<endl;
      int rightcount = n - 1 - r1;
      int count = r1 - l1 + 1;
      if (rightcount > count) {
        l1 = max(0, l1 - (rightcount - count));
        count = r1 - l1 + 1;
      }
      if (n - count == r1 + 1) {
        ret = f[2][n - 1] - f[2][r1];
        if (l1 > 0) {
          if ((l1 - 1) & 1)ret += f[1][l1 - 1];
          else ret += f[0][l1 - 1];
        }
      } else {
        ret = f[2][n - 1] - f[2][r1];
        if (l1 - 1 > 0) {
          if ((l1 - 2) & 1)ret += f[1][l1 - 2];
          else ret += f[0][l1 - 2];
        }
      }
    }
    //printf("%lld %d ",bf(x) - ret, x);
    printf("%lld\n", ret);
  }
  return 0;
}

Measured memory_bytes: 4480