from heapq import heapify, heappop, heappush



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

arr = [-x for x in map(int, input().split())]

heapify(arr)



for _ in range(m):

    tmp = heappop(arr)

    heappush(arr, int(tmp / 2))



print((-sum(arr)))
from heapq import heappop, heappush, heapify



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

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

arr = [-x for x in arr]



heapify(arr)



for _ in range(m):

    a = heappop(arr)

    heappush(arr, -(-a // 2))



print((-sum(arr)))
from heapq import heapify, heappop, heappush

n, m = list(map(int, input().split()))
arr = [-x for x in map(int, input().split())]
heapify(arr)
for _ in range(m):
    tmp = heappop(arr)
    heappush(arr, int(tmp / 2))
print((-sum(arr)))

from heapq import heappop, heappush, heapify

n, m = list(map(int, input().split()))
arr = list(map(int, input().split()))
arr = [-x for x in arr]
heapify(arr)
for _ in range(m):
    a = heappop(arr)
    heappush(arr, -(-a // 2))
print((-sum(arr)))

-from heapq import heapify, heappop, heappush +from heapq import heappop, heappush, heapify -arr = [-x for x in map(int, input().split())] +arr = list(map(int, input().split())) +arr = [-x for x in arr] -    tmp = heappop(arr) -    heappush(arr, int(tmp / 2)) +    a = heappop(arr) +    heappush(arr, -(-a // 2))