# 「毎回最大のやつ取れない限り無理じゃね...?」 <- それできます。優先度付きキューならね
import heapq
from functools import reduce
n, m = map(int, input().split())
arr = list(map(lambda x: int(x) * -1, input().split()))
heapq.heapify(arr)
for i in range(m):
    t = -1 * heapq.heappop(arr)
    heapq.heappush(arr, -1 * (t // 2))
print(-1 * reduce(lambda a, b: a + b, arr)) import heapq heapq from functools import reduce n, m = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split m arr = list(map(lambda x: int(x) * -1, input().split())) arr 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(arr) heapq.heapify heapq heapify arr for i in range(m):
    t = -1 * heapq.heappop(arr)
    heapq.heappush(arr, -1 * (t // 2)) i range(m) range m t = -1 * heapq.heappop(arr) t -1 * heapq.heappop(arr) -1 heapq.heappop(arr) heapq.heappop heapq heappop arr heapq.heappush(arr, -1 * (t // 2)) heapq.heappush heapq heappush arr -1 * (t // 2) -1 t // 2 t 2 print(-1 * reduce(lambda a, b: a + b, arr)) print -1 * reduce(lambda a, b: a + b, arr) -1 reduce(lambda a, b: a + b, arr) reduce lambda a, b: a + b a + b a b a b arr n, m = map(int, input().split()) map(int, input().split()) n m = map(int, input().split()) map(int, input().split()) m arr = list(map(lambda x: int(x) * -1, input().split())) list(map(lambda x: int(x) * -1, input().split())) arr t = -1 * heapq.heappop(arr) -1 * heapq.heappop(arr) t
# 「毎回最大のやつ取れない限り無理じゃね...?」 <- それできます。優先度付きキューならね
import heapq
from functools import reduce
n, m = map(int, input().split())
arr = list(map(lambda x: int(x) * -1, input().split()))
heapq.heapify(arr)
for i in range(m):
    t = -1 * heapq.heappop(arr)
    heapq.heappush(arr, -1 * (t // 2))
print(-1 * reduce(lambda a, b: a + b, arr))
