import heapq

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

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

a = list([x*(-1) for x in a])

heapq.heapify(a)



for _ in range(M):

  X = heapq.heappop(a)

  heapq.heappush(a, X/2)



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

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

A = [-a for a in list(map(int, input().split()))]

heapify(A)

for _ in range(M):

  p = heappop(A)

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

print((-sum(A)))
import heapq

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

from heapq import heapify, heappop, heappush

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

-import heapq +from heapq import heapify, heappop, heappush -a = list(map(int, input().split())) -a = list([x * (-1) for x in a]) -heapq.heapify(a) +A = [-a for a in list(map(int, input().split()))] +heapify(A) -    X = heapq.heappop(a) -    heapq.heappush(a, X / 2) -print((sum(int(-x) for x in a))) +    p = heappop(A) +    heappush(A, -((-p) // 2)) +print((-sum(A)))