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

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



from queue import PriorityQueue



q = PriorityQueue()

for a in aa:

    q.put(-a)

for i in range(m):

    g = q.get()

    q.put(-(-g // 2))

cost = 0

for a in aa:

    cost -=q.get()

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

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

import heapq



for i in range(len(aa)):

    aa[i] = -aa[i]

heapq.heapify(aa)



for i in range(m):

    v = heapq.heappop(aa)

    heapq.heappush(aa,-(-v // 2))

cost = 0

for i in range(len(aa)):

    cost -=heapq.heappop(aa)

print(cost)
n, m = list(map(int, input().split()))
aa = list(map(int, input().split()))
from queue import PriorityQueue

q = PriorityQueue()
for a in aa:
    q.put(-a)
for i in range(m):
    g = q.get()
    q.put(-(-g // 2))
cost = 0
for a in aa:
    cost -= q.get()
print(cost)

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

for i in range(len(aa)):
    aa[i] = -aa[i]
heapq.heapify(aa)
for i in range(m):
    v = heapq.heappop(aa)
    heapq.heappush(aa, -(-v // 2))
cost = 0
for i in range(len(aa)):
    cost -= heapq.heappop(aa)
print(cost)

-from queue import PriorityQueue +import heapq -q = PriorityQueue() -for a in aa: -    q.put(-a) +for i in range(len(aa)): +    aa[i] = -aa[i] +heapq.heapify(aa) -    g = q.get() -    q.put(-(-g // 2)) +    v = heapq.heappop(aa) +    heapq.heappush(aa, -(-v // 2)) -for a in aa: -    cost -= q.get() +for i in range(len(aa)): +    cost -= heapq.heappop(aa)