import heapq, math

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

n, m = map(int, input().split())
A = list(map(int, input().split()))
a = list(map(lambda x: x*(-1), A))
heapq.heapify(a)
for i in range(m):
    max_a = heapq.heappop(a)
    heapq.heappush(a, math.ceil(max_a/2))
print(-sum(a))