import heapq

n,m=map(int,input().split())
*a,=map(int,input().split())

q=[]
for aa in a:
    heapq.heappush(q,-aa)

while m>0:
    aa=heapq.heappop(q)
    heapq.heappush(q,-((-aa)//2))
    m-=1

print(-sum(q)) import heapq heapq n,m=map(int,input().split()) n map(int,input().split()) map int input().split() ().split () input split m *a,=map(int,input().split()) *a a map(int,input().split()) map int input().split() ().split () input split q=[] q [] for aa in a:
    heapq.heappush(q,-aa) aa a heapq.heappush(q,-aa) heapq.heappush heapq heappush q -aa aa while m>0:
    aa=heapq.heappop(q)
    heapq.heappush(q,-((-aa)//2))
    m-=1 m>0 m 0 aa=heapq.heappop(q) aa heapq.heappop(q) heapq.heappop heapq heappop q heapq.heappush(q,-((-aa)//2)) heapq.heappush heapq heappush q -((-aa)//2) (-aa)//2 -aa aa 2 m-=1 m 1 print(-sum(q)) print -sum(q) sum(q) sum q q=[] [] q aa=heapq.heappop(q) heapq.heappop(q) aa n,m=map(int,input().split()) map(int,input().split()) n m=map(int,input().split()) map(int,input().split()) m m-=1 1 m
import heapq

n,m=map(int,input().split())
*a,=map(int,input().split())

q=[]
for aa in a:
    heapq.heappush(q,-aa)

while m>0:
    aa=heapq.heappop(q)
    heapq.heappush(q,-((-aa)//2))
    m-=1

print(-sum(q))