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