import bisect

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

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

for i in range(M):

    bisect.insort(A, A.pop()//2)

print((sum(A)))
import heapq

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

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

heapq.heapify(A)

for i in range(M):

    a = heapq.heappop(A)

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

print((-sum(A)))
import bisect

N, M = list(map(int, input().split()))
A = sorted(map(int, input().split()))
for i in range(M):
    bisect.insort(A, A.pop() // 2)
print((sum(A)))

import heapq

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

-import bisect +import heapq -A = sorted(map(int, input().split())) +A = list([-int(x) for x in input().split()]) +heapq.heapify(A) -    bisect.insort(A, A.pop() // 2) -print((sum(A))) +    a = heapq.heappop(A) +    heapq.heappush(A, -(-a // 2)) +print((-sum(A)))