n, m = gets.chomp.split.map(&:to_i)
a = gets.chomp.split.map(&:to_i)

sorted = a.sort
while m > 0
  max = sorted[n-1]
  sorted[n-1] /= 2
  m -= 1
  break if m == 0
  (n-2).downto(0) do |i|
    if (max / 2) < sorted[i]
      sorted[i] /= 2
      m -= 1
    else
      break
    end
    break if m == 0
  end
  sorted = sorted.sort unless m == 0
end

p sorted.inject(:+)



