import heapq
import math

n,m=map(int,input().split())
aa=list(map(int,input().split()))
a=[i*(-1) for i in aa]
heapq.heapify(a)

for i in range(m):
    high=heapq.heappop(a)
    heapq.heappush(a,-math.floor(-high/2))

print(-sum(a)) import heapq heapq import math math n,m=map(int,input().split()) n map(int,input().split()) map int input().split() ().split () input split m aa=list(map(int,input().split())) aa list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split i*(-1) for i in aa for i in aa i aa for i in aa i*(-1) i -1 a=[i*(-1) for i in aa] a [i*(-1) for i in aa] heapq.heapify(a) heapq.heapify heapq heapify a for i in range(m):
    high=heapq.heappop(a)
    heapq.heappush(a,-math.floor(-high/2)) i range(m) range m high=heapq.heappop(a) high heapq.heappop(a) heapq.heappop heapq heappop a heapq.heappush(a,-math.floor(-high/2)) heapq.heappush heapq heappush a -math.floor(-high/2) math.floor(-high/2) math.floor math floor -high/2 -high high 2 print(-sum(a)) print -sum(a) sum(a) sum a high=heapq.heappop(a) heapq.heappop(a) high a=[i*(-1) for i in aa] [i*(-1) for i in aa] a n,m=map(int,input().split()) map(int,input().split()) n aa=list(map(int,input().split())) list(map(int,input().split())) aa m=map(int,input().split()) map(int,input().split()) m
import heapq
import math

n,m=map(int,input().split())
aa=list(map(int,input().split()))
a=[i*(-1) for i in aa]
heapq.heapify(a)

for i in range(m):
    high=heapq.heappop(a)
    heapq.heappush(a,-math.floor(-high/2))

print(-sum(a))
