import heapq



n,m = list(map(int,input().split()))



a = list(map(int,input().split()))



a = [-1*i for i in a]



heapq.heapify(a)



count = 0



while count < m:

    item = heapq.heappop(a)

    item= abs(item)

    discount_item = item//2

    heapq.heappush(a,-1*discount_item)

    count += 1



print((abs(sum(a))))
import heapq



N,M = list(map(int,input().split()))



T = list(map(int,input().split()))



memo = []

for t in T:

    memo.append(-t)

memo.sort()



for m in range(M):

    tmp = heapq.heappop(memo)

    tmp = int(tmp/2)

    heapq.heappush(memo,tmp)

print((-1*sum(memo)))

import heapq

n, m = list(map(int, input().split()))
a = list(map(int, input().split()))
a = [-1 * i for i in a]
heapq.heapify(a)
count = 0
while count < m:
    item = heapq.heappop(a)
    item = abs(item)
    discount_item = item // 2
    heapq.heappush(a, -1 * discount_item)
    count += 1
print((abs(sum(a))))

import heapq

N, M = list(map(int, input().split()))
T = list(map(int, input().split()))
memo = []
for t in T:
    memo.append(-t)
memo.sort()
for m in range(M):
    tmp = heapq.heappop(memo)
    tmp = int(tmp / 2)
    heapq.heappush(memo, tmp)
print((-1 * sum(memo)))

-n, m = list(map(int, input().split())) -a = list(map(int, input().split())) -a = [-1 * i for i in a] -heapq.heapify(a) -count = 0 -while count < m: -    item = heapq.heappop(a) -    item = abs(item) -    discount_item = item // 2 -    heapq.heappush(a, -1 * discount_item) -    count += 1 -print((abs(sum(a)))) +N, M = list(map(int, input().split())) +T = list(map(int, input().split())) +memo = [] +for t in T: +    memo.append(-t) +memo.sort() +for m in range(M): +    tmp = heapq.heappop(memo) +    tmp = int(tmp / 2) +    heapq.heappush(memo, tmp) +print((-1 * sum(memo)))