from heapq import heappush, heappop, heapify

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

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

heap = [-a for a in A]

heapify(heap)

for i in range(M):

    hmax = heappop(heap)

    heappush(heap, hmax/2)

print((sum([int(-x) for x in heap])))
from heapq import heapify, heappush, heappop

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

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

A = list([-x for x in A])

heapify(A)

for i in range(M):

    mx = heappop(A)

    heappush(A, (-1)*(-mx//2))

A = list([-x for x in A])

print((sum(A)))
from heapq import heappush, heappop, heapify

N, M = list(map(int, input().split()))
A = list(map(int, input().split()))
heap = [-a for a in A]
heapify(heap)
for i in range(M):
    hmax = heappop(heap)
    heappush(heap, hmax / 2)
print((sum([int(-x) for x in heap])))

from heapq import heapify, heappush, heappop

N, M = list(map(int, input().split()))
A = list(map(int, input().split()))
A = list([-x for x in A])
heapify(A)
for i in range(M):
    mx = heappop(A)
    heappush(A, (-1) * (-mx // 2))
A = list([-x for x in A])
print((sum(A)))

-from heapq import heappush, heappop, heapify +from heapq import heapify, heappush, heappop -heap = [-a for a in A] -heapify(heap) +A = list([-x for x in A]) +heapify(A) -    hmax = heappop(heap) -    heappush(heap, hmax / 2) -print((sum([int(-x) for x in heap]))) +    mx = heappop(A) +    heappush(A, (-1) * (-mx // 2)) +A = list([-x for x in A]) +print((sum(A)))