import heapq

n, m = map(int, input().split())
a = list(map(lambda x: int(x)*(-1), input().split()))
heapq.heapify(a)

while m > 0:
    a_max = heapq.heappop(a)
    if a_max == 0:
        break
    heapq.heappush(a, (-1)*(-a_max // 2))
    m -= 1
print(sum(a)*(-1)) 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)*(-1), input().split())) a list(map(lambda x: int(x)*(-1), input().split())) list map(lambda x: int(x)*(-1), input().split()) map lambda x: int(x)*(-1) int(x)*(-1) int(x) int x -1 x input().split() ().split () input split heapq.heapify(a) heapq.heapify heapq heapify a while m > 0:
    a_max = heapq.heappop(a)
    if a_max == 0:
        break
    heapq.heappush(a, (-1)*(-a_max // 2))
    m -= 1 m > 0 m 0 a_max = heapq.heappop(a) a_max heapq.heappop(a) heapq.heappop heapq heappop a if a_max == 0:
        break
     a_max == 0 a_max 0 break heapq.heappush(a, (-1)*(-a_max // 2)) heapq.heappush heapq heappush a (-1)*(-a_max // 2) -1 -a_max // 2 -a_max a_max 2 m -= 1 m 1 print(sum(a)*(-1)) print sum(a)*(-1) sum(a) sum a -1 n, m = map(int, input().split()) map(int, input().split()) n a_max = heapq.heappop(a) heapq.heappop(a) a_max m = map(int, input().split()) map(int, input().split()) m m -= 1 1 m a = list(map(lambda x: int(x)*(-1), input().split())) list(map(lambda x: int(x)*(-1), input().split())) a
import heapq

n, m = map(int, input().split())
a = list(map(lambda x: int(x)*(-1), input().split()))
heapq.heapify(a)

while m > 0:
    a_max = heapq.heappop(a)
    if a_max == 0:
        break
    heapq.heappush(a, (-1)*(-a_max // 2))
    m -= 1
print(sum(a)*(-1))