from heapq import *
n,m = map(int,input().split())
a = list(map(int,input().split()))

heap = []
for i in a:
    heappush(heap,-i)

for _ in range(m):
    tmp = heappop(heap)
    heappush(heap,-(-tmp//2))

ans = 0
for a in heap:
    ans += -a 
print(ans) from heapq import * n,m = map(int,input().split()) n map(int,input().split()) map int input().split() ().split () input split m a = list(map(int,input().split())) a list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split heap = [] heap [] for i in a:
    heappush(heap,-i) i a heappush(heap,-i) heappush heap -i i for _ in range(m):
    tmp = heappop(heap)
    heappush(heap,-(-tmp//2)) _ range(m) range m tmp = heappop(heap) tmp heappop(heap) heappop heap heappush(heap,-(-tmp//2)) heappush heap -(-tmp//2) -tmp//2 -tmp tmp 2 ans = 0 ans 0 for a in heap:
    ans += -a  a heap ans += -a ans -a a print(ans) print ans a = list(map(int,input().split())) list(map(int,input().split())) a tmp = heappop(heap) heappop(heap) tmp m = map(int,input().split()) map(int,input().split()) m n,m = map(int,input().split()) map(int,input().split()) n ans = 0 0 ans heap = [] [] heap ans += -a -a ans
from heapq import *
n,m = map(int,input().split())
a = list(map(int,input().split()))

heap = []
for i in a:
    heappush(heap,-i)

for _ in range(m):
    tmp = heappop(heap)
    heappush(heap,-(-tmp//2))

ans = 0
for a in heap:
    ans += -a 
print(ans)