MOD=10**9+7
cnt=0; sum=0; prev=nil; h=Hash.new(0)
def gs() gets.chomp end
def gi() gets.to_i end
def gsmi() gets.chomp.split.map(&:to_i) end

def desc(ar) ar.sort!{|x,y|y<=>x} end
def min(a,b) a<=b ? a : b end
def max(a,b) a>=b ? a : b end

def puts_yesno(can) puts(can ? 'Yes' : 'No') end
def putsend(s) puts s; exit end
def debug(k,v) puts "#{k}:#{v}" end
########### ( ˘ω˘ )ｽﾔｧ… ###########
n, m = gsmi
a = desc gsmi

half = []
while m>0 do
  if half.size==0
    half << a.shift/2
  elsif a.size==0
    half << half.shift/2
  else
    if half[0] < a[0]
      half << a.shift/2
    else
      half << half.shift/2
    end
  end
  m -= 1
  desc(half)
end

puts half.inject(:+).to_i + a.inject(:+).to_i