import heapq

n, m = map(int, input().split())
alst = list(map(int, input().split()))
heap = [-1 * num for num in alst]
ans = sum(alst)
heapq.heapify(heap)

num = heapq.heappop(heap)
for _ in range(m):
    num *= -1
    tmp = num // 2
    ans -= num - tmp
    tmp *= -1
    num = heapq.heappushpop(heap, tmp)
print(ans) import heapq heapq n, m = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split m alst = list(map(int, input().split())) alst list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split -1 * num for num in alst for num in alst num alst for num in alst -1 * num -1 num heap = [-1 * num for num in alst] heap [-1 * num for num in alst] ans = sum(alst) ans sum(alst) sum alst heapq.heapify(heap) heapq.heapify heapq heapify heap num = heapq.heappop(heap) num heapq.heappop(heap) heapq.heappop heapq heappop heap for _ in range(m):
    num *= -1
    tmp = num // 2
    ans -= num - tmp
    tmp *= -1
    num = heapq.heappushpop(heap, tmp) _ range(m) range m num *= -1 num -1 tmp = num // 2 tmp num // 2 num 2 ans -= num - tmp ans num - tmp num tmp tmp *= -1 tmp -1 num = heapq.heappushpop(heap, tmp) num heapq.heappushpop(heap, tmp) heapq.heappushpop heapq heappushpop heap tmp print(ans) print ans ans -= num - tmp num - tmp ans num = heapq.heappushpop(heap, tmp) heapq.heappushpop(heap, tmp) num num *= -1 -1 num tmp *= -1 -1 tmp ans = sum(alst) sum(alst) ans tmp = num // 2 num // 2 tmp n, m = map(int, input().split()) map(int, input().split()) n alst = list(map(int, input().split())) list(map(int, input().split())) alst heap = [-1 * num for num in alst] [-1 * num for num in alst] heap num = heapq.heappop(heap) heapq.heappop(heap) num m = map(int, input().split()) map(int, input().split()) m
import heapq

n, m = map(int, input().split())
alst = list(map(int, input().split()))
heap = [-1 * num for num in alst]
ans = sum(alst)
heapq.heapify(heap)

num = heapq.heappop(heap)
for _ in range(m):
    num *= -1
    tmp = num // 2
    ans -= num - tmp
    tmp *= -1
    num = heapq.heappushpop(heap, tmp)
print(ans)
