from heapq import heapify, heappush, heappop



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

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



PQ = [-A for A in As]

heapify(PQ)



for _ in range(M):

    A = -heappop(PQ)

    heappush(PQ, -A/2)



ans = 0

while PQ:

    A = -heappop(PQ)

    ans += int(A)



print(ans)

from heapq import heapify, heappush, heappop



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

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



PQ = [-A for A in As]

heapify(PQ)



for _ in range(M):

    A = -heappop(PQ)

    heappush(PQ, -(A//2))



#print('PQ:', PQ)



print((-sum(PQ)))

from heapq import heapify, heappush, heappop

N, M = list(map(int, input().split()))
As = list(map(int, input().split()))
PQ = [-A for A in As]
heapify(PQ)
for _ in range(M):
    A = -heappop(PQ)
    heappush(PQ, -A / 2)
ans = 0
while PQ:
    A = -heappop(PQ)
    ans += int(A)
print(ans)

from heapq import heapify, heappush, heappop

N, M = list(map(int, input().split()))
As = list(map(int, input().split()))
PQ = [-A for A in As]
heapify(PQ)
for _ in range(M):
    A = -heappop(PQ)
    heappush(PQ, -(A // 2))
# print('PQ:', PQ)
print((-sum(PQ)))

-    heappush(PQ, -A / 2) -ans = 0 -while PQ: -    A = -heappop(PQ) -    ans += int(A) -print(ans) +    heappush(PQ, -(A // 2)) +# print('PQ:', PQ) +print((-sum(PQ)))