import heapq as hp

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

for i in range(n):
    a[i] = a[i] * (-1)
hp.heapify(a)

for _ in range(m):
    max_price = (-1) * hp.heappop(a)
    hp.heappush(a, (-1) * (max_price // 2))

print(-sum(a)) import heapq as hp 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 for i in range(n):
    a[i] = a[i] * (-1) i range(n) range n a[i] = a[i] * (-1) a[i] a i a[i] * (-1) a[i] a i -1 hp.heapify(a) hp.heapify hp heapify a for _ in range(m):
    max_price = (-1) * hp.heappop(a)
    hp.heappush(a, (-1) * (max_price // 2)) _ range(m) range m max_price = (-1) * hp.heappop(a) max_price (-1) * hp.heappop(a) -1 hp.heappop(a) hp.heappop hp heappop a hp.heappush(a, (-1) * (max_price // 2)) hp.heappush hp heappush a (-1) * (max_price // 2) -1 max_price // 2 max_price 2 print(-sum(a)) print -sum(a) sum(a) sum a n, m = map(int, input().split()) map(int, input().split()) n m = map(int, input().split()) map(int, input().split()) m a = list(map(int, input().split())) list(map(int, input().split())) a max_price = (-1) * hp.heappop(a) (-1) * hp.heappop(a) max_price
import heapq as hp

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

for i in range(n):
    a[i] = a[i] * (-1)
hp.heapify(a)

for _ in range(m):
    max_price = (-1) * hp.heappop(a)
    hp.heappush(a, (-1) * (max_price // 2))

print(-sum(a))