program nearest_card_game
  implicit none
  integer :: n, q, i, l, h, m
  integer(8) :: x, a(100000), s(0:100000), e(0:100000)
  a = 0_8
  s = 0_8
  e = 0_8
  read(*,*) n, q
  read(*,*) a(1:n)
  if (n.le.2) then
    do i = 1, q
      write(*,'(i0)') a(n)
    end do
    stop
  end if
  do i = 1, n
    s(i) = s(i-1)+a(i)
  end do
  e(1) = a(1)
  do i = 2, n
    e(i) = e(i-2)+a(i)
  end do
  do i = 1, q
    read(*,*) x
    h = (n-1)/2
    if (abs(x-a(n-2*h)).le.abs(x-a(n-h))) then
      write(*,'(i0)') s(n)-s(n/2)
      cycle
    end if
    l = -1
    do while (h-l.gt.1)
      m = (h+l)/2
      if (abs(x-a(n-2*m)).gt.abs(x-a(n-m))) then
        h = m
      else
        l = m
      end if
    end do
    write(*,'(i0)') e(n-2*h)+s(n)-s(n-h)
  end do
  stop
end program nearest_card_game