import heapq



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

A = []

for a in map(int,input().split()):

  heapq.heappush(A,-a)



cnt = 0

while cnt < M:

  a = heapq.heappop(A)

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

  cnt += 1

print((-sum(A)))
import heapq

import math



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

A = []

for a in map(int, input().split()):

    heapq.heappush(A, -a)



for _ in range(M):

    neg_a = heapq.heappop(A)

    heapq.heappush(A, -math.floor(-neg_a/2))



print((-sum(A)))
import heapq

N, M = list(map(int, input().split()))
A = []
for a in map(int, input().split()):
    heapq.heappush(A, -a)
cnt = 0
while cnt < M:
    a = heapq.heappop(A)
    heapq.heappush(A, -((-a) // 2))
    cnt += 1
print((-sum(A)))

import heapq
import math

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

+import math -cnt = 0 -while cnt < M: -    a = heapq.heappop(A) -    heapq.heappush(A, -((-a) // 2)) -    cnt += 1 +for _ in range(M): +    neg_a = heapq.heappop(A) +    heapq.heappush(A, -math.floor(-neg_a / 2))