import heapq

N, M = map(int, input().split())
A = list(map(int, input().split()))
A = list(map(lambda x: x*(-1), A))
heapq.heapify(A)

for _ in range(M):
    a = ((heapq.heappop(A)*-1)//2)*-1
    if a != 0:
        heapq.heappush(A, a)

    if len(A) == 0:
        break

print(sum(A)*-1) import heapq heapq 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 A = list(map(lambda x: x*(-1), A)) A list(map(lambda x: x*(-1), A)) list map(lambda x: x*(-1), A) map lambda x: x*(-1) x*(-1) x -1 x A heapq.heapify(A) heapq.heapify heapq heapify A for _ in range(M):
    a = ((heapq.heappop(A)*-1)//2)*-1
    if a != 0:
        heapq.heappush(A, a)

    if len(A) == 0:
        break _ range(M) range M a = ((heapq.heappop(A)*-1)//2)*-1 a ((heapq.heappop(A)*-1)//2)*-1 (heapq.heappop(A)*-1)//2 heapq.heappop(A)*-1 heapq.heappop(A) heapq.heappop heapq heappop A -1 2 -1 if a != 0:
        heapq.heappush(A, a)

     a != 0 a 0 heapq.heappush(A, a) heapq.heappush heapq heappush A a if len(A) == 0:
        break len(A) == 0 len(A) len A 0 break print(sum(A)*-1) print sum(A)*-1 sum(A) sum A -1 M = map(int, input().split()) map(int, input().split()) M A = list(map(lambda x: x*(-1), A)) list(map(lambda x: x*(-1), A)) A A = list(map(int, input().split())) list(map(int, input().split())) A N, M = map(int, input().split()) map(int, input().split()) N a = ((heapq.heappop(A)*-1)//2)*-1 ((heapq.heappop(A)*-1)//2)*-1 a
import heapq

N, M = map(int, input().split())
A = list(map(int, input().split()))
A = list(map(lambda x: x*(-1), A))
heapq.heapify(A)

for _ in range(M):
    a = ((heapq.heappop(A)*-1)//2)*-1
    if a != 0:
        heapq.heappush(A, a)

    if len(A) == 0:
        break

print(sum(A)*-1)
