from heapq import heapify, heappush, heappop

n, m = map(int, input().split())
A = list(map(int, input().split()))

A = list(map(lambda x: x * (-1), A))

heapify(A)
for i in range(m):
    x = heappop(A)
    x = (x + 1) // 2
    heappush(A, x)

print(-1 * sum(A)) from heapq import heapify, heappush, heappop 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 heapify(A) heapify A for i in range(m):
    x = heappop(A)
    x = (x + 1) // 2
    heappush(A, x) i range(m) range m x = heappop(A) x heappop(A) heappop A x = (x + 1) // 2 x (x + 1) // 2 x + 1 x 1 2 heappush(A, x) heappush A x print(-1 * sum(A)) print -1 * sum(A) -1 sum(A) sum A n, m = map(int, input().split()) map(int, input().split()) n x = heappop(A) heappop(A) x x = (x + 1) // 2 (x + 1) // 2 x A = list(map(int, input().split())) list(map(int, input().split())) A A = list(map(lambda x: x * (-1), A)) list(map(lambda x: x * (-1), A)) A m = map(int, input().split()) map(int, input().split()) m
from heapq import heapify, heappush, heappop

n, m = map(int, input().split())
A = list(map(int, input().split()))

A = list(map(lambda x: x * (-1), A))

heapify(A)
for i in range(m):
    x = heappop(A)
    x = (x + 1) // 2
    heappush(A, x)

print(-1 * sum(A))
