import heapq

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

n, m = map(int, input().split())
A = list(map(lambda x: -int(x), input().split()))
heapq.heapify(A)
for _ in range(m):
    max_price = -heapq.heappop(A) // 2
    heapq.heappush(A, -max_price)
total = -sum(A)
print(total)
