import heapq

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

A = [-int(i) for i in input().split()]

heapq.heapify(A)

for i in range(M):

    a = -int(heapq.heappop(A) / 2)

    heapq.heappush(A, -a)

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

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

A = [-int(i) for i in input().split()]

heapq.heapify(A)

for i in range(M):

    a = -heapq.heappop(A) // 2

    heapq.heappush(A, -a)

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

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

import heapq

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

-    a = -int(heapq.heappop(A) / 2) +    a = -heapq.heappop(A) // 2