from heapq import heappush, heappop



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

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



h = []

for a in A:

    heappush(h, -a)

for _ in range(M):

    heappush(h, -(-heappop(h) // 2))



print((-sum(h)))
from heapq import heappush, heappop



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

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



h = []

for a in A:

    heappush(h, -a)

for _ in range(M):

    a = -heappop(h) // 2

    heappush(h, -a)



print((-sum(h)))
from heapq import heappush, heappop

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

from heapq import heappush, heappop

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

-    heappush(h, -(-heappop(h) // 2)) +    a = -heappop(h) // 2 +    heappush(h, -a)