import heapq

N, M = [int(x) for x in input().split()]
A = [-int(x) for x in input().split()]

heapq.heapify(A)

for i in range(M):
    a = heapq.heappop(A)
    heapq.heappush(A, -((-a)//2))

ans = -sum(A)

print(ans) import heapq heapq int(x) for x in input().split() for x in input().split() x input().split() ().split () input split for x in input().split() int(x) int x N, M = [int(x) for x in input().split()] N [int(x) for x in input().split()] M -int(x) for x in input().split() for x in input().split() x input().split() ().split () input split for x in input().split() -int(x) int(x) int x A = [-int(x) for x in input().split()] A [-int(x) for x in input().split()] heapq.heapify(A) heapq.heapify heapq heapify A for i in range(M):
    a = heapq.heappop(A)
    heapq.heappush(A, -((-a)//2)) i range(M) range M a = heapq.heappop(A) a heapq.heappop(A) heapq.heappop heapq heappop A heapq.heappush(A, -((-a)//2)) heapq.heappush heapq heappush A -((-a)//2) (-a)//2 -a a 2 ans = -sum(A) ans -sum(A) sum(A) sum A print(ans) print ans A = [-int(x) for x in input().split()] [-int(x) for x in input().split()] A N, M = [int(x) for x in input().split()] [int(x) for x in input().split()] N a = heapq.heappop(A) heapq.heappop(A) a ans = -sum(A) -sum(A) ans M = [int(x) for x in input().split()] [int(x) for x in input().split()] M
import heapq

N, M = [int(x) for x in input().split()]
A = [-int(x) for x in input().split()]

heapq.heapify(A)

for i in range(M):
    a = heapq.heappop(A)
    heapq.heappush(A, -((-a)//2))

ans = -sum(A)

print(ans)