import heapq

# 優先度付きキューは「最も値が小さいもの」を出すことに注意

prio = []

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

for num in nums:
    heapq.heappush(prio, -num)

for i in range(m):
    temp = heapq.heappop(prio)
    heapq.heappush(prio, -((-temp) // 2))

print(-sum(prio)) import heapq heapq prio = [] prio [] n, m =list(map(int, input().split())) n list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split m nums =list(map(int, input().split())) nums list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split for num in nums:
    heapq.heappush(prio, -num) num nums heapq.heappush(prio, -num) heapq.heappush heapq heappush prio -num num for i in range(m):
    temp = heapq.heappop(prio)
    heapq.heappush(prio, -((-temp) // 2)) i range(m) range m temp = heapq.heappop(prio) temp heapq.heappop(prio) heapq.heappop heapq heappop prio heapq.heappush(prio, -((-temp) // 2)) heapq.heappush heapq heappush prio -((-temp) // 2) (-temp) // 2 -temp temp 2 print(-sum(prio)) print -sum(prio) sum(prio) sum prio m =list(map(int, input().split())) list(map(int, input().split())) m n, m =list(map(int, input().split())) list(map(int, input().split())) n nums =list(map(int, input().split())) list(map(int, input().split())) nums temp = heapq.heappop(prio) heapq.heappop(prio) temp prio = [] [] prio
import heapq

# 優先度付きキューは「最も値が小さいもの」を出すことに注意

prio = []

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

for num in nums:
    heapq.heappush(prio, -num)

for i in range(m):
    temp = heapq.heappop(prio)
    heapq.heappush(prio, -((-temp) // 2))

print(-sum(prio))
