import heapq 

N,M=map(int,input().split())
A=[-a for a in list(map(int,input().split()))]
heapq.heapify(A)
for _ in [0]*M:
    a=heapq.heappop(A)
    heapq.heappush(A,-((-a)//2))
    
res=0
for i in range(N):
    a=heapq.heappop(A)
    res+=-a
print(res) import heapq heapq N,M=map(int,input().split()) N map(int,input().split()) map int input().split() ().split () input split M -a for a in list(map(int,input().split())) for a in list(map(int,input().split())) a list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split for a in list(map(int,input().split())) -a a A=[-a for a in list(map(int,input().split()))] A [-a for a in list(map(int,input().split()))] heapq.heapify(A) heapq.heapify heapq heapify A for _ in [0]*M:
    a=heapq.heappop(A)
    heapq.heappush(A,-((-a)//2))
     _ [0]*M [0] 0 M a=heapq.heappop(A) a heapq.heappop(A) heapq.heappop heapq heappop A heapq.heappush(A,-((-a)//2)) heapq.heappush heapq heappush A -((-a)//2) (-a)//2 -a a 2 res=0 res 0 for i in range(N):
    a=heapq.heappop(A)
    res+=-a i range(N) range N a=heapq.heappop(A) a heapq.heappop(A) heapq.heappop heapq heappop A res+=-a res -a a print(res) print res res=0 0 res M=map(int,input().split()) map(int,input().split()) M res+=-a -a res a=heapq.heappop(A) heapq.heappop(A) a a=heapq.heappop(A) heapq.heappop(A) a N,M=map(int,input().split()) map(int,input().split()) N A=[-a for a in list(map(int,input().split()))] [-a for a in list(map(int,input().split()))] A
import heapq 

N,M=map(int,input().split())
A=[-a for a in list(map(int,input().split()))]
heapq.heapify(A)
for _ in [0]*M:
    a=heapq.heappop(A)
    heapq.heappush(A,-((-a)//2))
    
res=0
for i in range(N):
    a=heapq.heappop(A)
    res+=-a
print(res)