from heapq import heappush, heappop

N, M = map(int, input().split())
*A, = map(int, input().split())
q = []
for i in A:
    heappush(q, -i)

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

N, M = map(int, input().split())
*A, = map(int, input().split())
q = []
for i in A:
    heappush(q, -i)

for _ in range(M):
    a = -heappop(q)
    heappush(q, -(a//2))
print(-sum(q))