(N, M), As = readlines.map{|l| l.split.map(&:to_i)}

(puts As[0] / (2**M); exit) if N == 1
as = As.sort
M.times do
  x, y = as.pop(2)
  y /= 2
  x, y = y, x if x > y
  as << x << y
end
puts as.inject(:+)