object Main extends App {

  import scala.io.StdIn._
  val Array(n, q) = readLine.trim.split(' ').map(_.toInt)
  val cards = readLine.trim.split(' ').map(_.toLong).sorted
  val sumBySeq = cards.clone()
  for (i ← (1 until n).reverse) sumBySeq(i - 1) += sumBySeq(i)
  val sumByStep = cards.clone()
  for (i ← 2 until n) sumByStep(i) += sumByStep(i - 2)

  for (_ ← 0 until q){
    val x = readLine.trim.toLong
    val splitter = upperBound(1 to n) { c ⇒
      if (c * 2 - 1 <= n) {
        math.abs(cards(n - c * 2 + 1) - x) <= math.abs(cards(n - c) - x)
      }else false
    } - 1
    if (n > splitter * 2){
      println(sumBySeq(n - splitter) + sumByStep(n - splitter * 2 - 1))
    }else {
      println(sumBySeq(n - splitter))
    }
  }

  //[0, x) => true
  //[x, end) => falseになるx
  def upperBound(range: Range)(@inline func: Int ⇒ Boolean): Int = {
    var left = range.head
    var right = range.end
    while(left < right){
      val mid = (left + right) / 2
      if (func(mid)){
        left = mid + 1
      }else {
        right = mid
      }
    }
    right
  }

  implicit class Extension[T](value :T){
    @inline
    def let[A](@inline func: T ⇒ A): A = func(value)
    @inline
    def also(@inline func: T ⇒ Unit): T = {func(value); value}
  }
}