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

A.sort!.reverse!

bottom = 0
ticket = 0
lte = (0...N).find{|i|
	msb = A[i].bit_length
	next true if msb <= bottom
 	ticket += msb - bottom
	if M < ticket
		up = (ticket-M+i)/(i+1)
		bottom += up
		ticket -= up*(i+1)
	end
	false
}||N
lte.times.each{|i|
	A[i] >>= A[i].bit_length - bottom
}
lt = (lte...N).find{|i|
	A[i].bit_length < bottom
}||N
lt.times.sort_by{|i| -A[i] }.take(M-ticket).each{|i|
	A[i] >>= 1
} if ticket < M

p A.inject(&:+)
