from queue import PriorityQueue



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

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

queue = PriorityQueue(N)



for a in A:

    queue.put(-a)



for i in range(M):

    a = -queue.get()

    a /= 2

    queue.put(-a)



ans = 0

for i in range(N):

    ans += int(-queue.get())

print(ans)

from heapq import heapify, heappush, heappop



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

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

heapify(A)



for i in range(M):

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



print((-sum(A)))

from queue import PriorityQueue

N, M = list(map(int, input().split()))
A = list(map(int, input().split()))
queue = PriorityQueue(N)
for a in A:
    queue.put(-a)
for i in range(M):
    a = -queue.get()
    a /= 2
    queue.put(-a)
ans = 0
for i in range(N):
    ans += int(-queue.get())
print(ans)

from heapq import heapify, heappush, heappop

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

-from queue import PriorityQueue +from heapq import heapify, heappush, heappop -A = list(map(int, input().split())) -queue = PriorityQueue(N) -for a in A: -    queue.put(-a) +A = list([-int(x) for x in input().split()]) +heapify(A) -    a = -queue.get() -    a /= 2 -    queue.put(-a) -ans = 0 -for i in range(N): -    ans += int(-queue.get()) -print(ans) +    heappush(A, -(-heappop(A) // 2)) +print((-sum(A)))