import heapq

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

a = list([int(x) * -1 for x in input().split()])

heapq.heapify(a)

for _ in range(m):

    tmp = (heapq.heappop(a) * (-1)) // 2

    heapq.heappush(a, -tmp)

print((sum(a) * -1))

from heapq import heapify, heappop, heappush



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

A = []

for i in input().split():

    A.append(-int(i))

heapify(A)

for _ in range(M):

    a = -heappop(A)

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

# print('A', A)

ans = -sum(A)

print(ans)

import heapq

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

from heapq import heapify, heappop, heappush

N, M = list(map(int, input().split()))
A = []
for i in input().split():
    A.append(-int(i))
heapify(A)
for _ in range(M):
    a = -heappop(A)
    heappush(A, (a // 2) * -1)
# print('A', A)
ans = -sum(A)
print(ans)

-import heapq +from heapq import heapify, heappop, heappush -n, m = list(map(int, input().split())) -a = list([int(x) * -1 for x in input().split()]) -heapq.heapify(a) -for _ in range(m): -    tmp = (heapq.heappop(a) * (-1)) // 2 -    heapq.heappush(a, -tmp) -print((sum(a) * -1)) +N, M = list(map(int, input().split())) +A = [] +for i in input().split(): +    A.append(-int(i)) +heapify(A) +for _ in range(M): +    a = -heappop(A) +    heappush(A, (a // 2) * -1) +# print('A', A) +ans = -sum(A) +print(ans)