import heapq



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

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

heapq.heapify(A)



for _ in range(M):

    tmp = heapq.heappop(A)

    heapq.heappush(A, -(-tmp // 2))



print((-sum(A)))

import heapq

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

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

res = -sum(A)

heapq.heapify(A)

for _ in range(M):

    a = heapq.heappop(A)

    a *= -1

    res -= (a - a // 2)

    a //= 2

    heapq.heappush(A, - a)

print(res)
import heapq

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

import heapq

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

+res = -sum(A) -    tmp = heapq.heappop(A) -    heapq.heappush(A, -(-tmp // 2)) -print((-sum(A))) +    a = heapq.heappop(A) +    a *= -1 +    res -= a - a // 2 +    a //= 2 +    heapq.heappush(A, -a) +print(res)