import heapq
N,M=map(int,input().split())
arr=list(map(int,input().split()))
hq=[]
for i in arr:
    heapq.heappush(hq,-i)

while M>0:
    a=heapq.heappop(hq)    
    heapq.heappush(hq,a/2)
    M-=1
    #print(hq)
ans=0
for i in hq:    
    ans+=int(-i)
    
print(ans) import heapq heapq N,M=map(int,input().split()) N map(int,input().split()) map int input().split() ().split () input split M arr=list(map(int,input().split())) arr list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split hq=[] hq [] for i in arr:
    heapq.heappush(hq,-i) i arr heapq.heappush(hq,-i) heapq.heappush heapq heappush hq -i i while M>0:
    a=heapq.heappop(hq)    
    heapq.heappush(hq,a/2)
    M-=1
    #print(hq) M>0 M 0 a=heapq.heappop(hq) a heapq.heappop(hq) heapq.heappop heapq heappop hq heapq.heappush(hq,a/2) heapq.heappush heapq heappush hq a/2 a 2 M-=1 M 1 ans=0 ans 0 for i in hq:    
    ans+=int(-i)
     i hq ans+=int(-i) ans int(-i) int -i i print(ans) print ans N,M=map(int,input().split()) map(int,input().split()) N ans+=int(-i) int(-i) ans M=map(int,input().split()) map(int,input().split()) M M-=1 1 M ans=0 0 ans hq=[] [] hq a=heapq.heappop(hq) heapq.heappop(hq) a arr=list(map(int,input().split())) list(map(int,input().split())) arr
import heapq
N,M=map(int,input().split())
arr=list(map(int,input().split()))
hq=[]
for i in arr:
    heapq.heappush(hq,-i)

while M>0:
    a=heapq.heappop(hq)    
    heapq.heappush(hq,a/2)
    M-=1
    #print(hq)
ans=0
for i in hq:    
    ans+=int(-i)
    
print(ans)