def max_index(array)
	max = 0
	index = 0
	array.each_with_index{|a,i|
		if a > max
			max = a 
			index = i
		end
	}
	index
end

N,M = gets.split.map(&:to_i)
price_goods = gets.split.map(&:to_i)

M.times do 
	price_goods[max_index(price_goods)] /= 2
end

puts price_goods
puts price_goods.inject{|x, y| x + y}