from heapq import heappush, heappop

N, M, *A = map(int, open(0).read().split())

q = []
for v in A:
    heappush(q, -v)
    
for _ in range(M):
    v = heappop(q)
    heappush(q, -((-v) // 2))
    
print(-sum(q)) from heapq import heappush, heappop N, M, *A = map(int, open(0).read().split()) N map(int, open(0).read().split()) map int open(0).read().split() (0).read().split (0).read() (0).read (0) open 0 read split M *A A q = [] q [] for v in A:
    heappush(q, -v)
     v A heappush(q, -v) heappush q -v v for _ in range(M):
    v = heappop(q)
    heappush(q, -((-v) // 2))
     _ range(M) range M v = heappop(q) v heappop(q) heappop q heappush(q, -((-v) // 2)) heappush q -((-v) // 2) (-v) // 2 -v v 2 print(-sum(q)) print -sum(q) sum(q) sum q q = [] [] q v = heappop(q) heappop(q) v M, *A = map(int, open(0).read().split()) map(int, open(0).read().split()) M N, M, *A = map(int, open(0).read().split()) map(int, open(0).read().split()) N
from heapq import heappush, heappop

N, M, *A = map(int, open(0).read().split())

q = []
for v in A:
    heappush(q, -v)
    
for _ in range(M):
    v = heappop(q)
    heappush(q, -((-v) // 2))
    
print(-sum(q))
