from heapq import heappushpop, heapify

N, M = map(int, input().split(' '))
A = list(map(int, input().split(' ')))

heap = [-a for a in A]
heapify(heap)

for _ in range(M):
    heappushpop(heap, (-1 * heap[0] // 2) * -1)

print(-1 * sum(heap)) from heapq import heappushpop, heapify 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 for a in A for a in A a A for a in A -a a heap = [-a for a in A] heap [-a for a in A] heapify(heap) heapify heap for _ in range(M):
    heappushpop(heap, (-1 * heap[0] // 2) * -1) _ range(M) range M heappushpop(heap, (-1 * heap[0] // 2) * -1) heappushpop heap (-1 * heap[0] // 2) * -1 -1 * heap[0] // 2 -1 * heap[0] -1 heap[0] heap 0 2 -1 print(-1 * sum(heap)) print -1 * sum(heap) -1 sum(heap) sum heap A = list(map(int, input().split(' '))) list(map(int, input().split(' '))) A M = map(int, input().split(' ')) map(int, input().split(' ')) M N, M = map(int, input().split(' ')) map(int, input().split(' ')) N heap = [-a for a in A] [-a for a in A] heap
from heapq import heappushpop, heapify

N, M = map(int, input().split(' '))
A = list(map(int, input().split(' ')))

heap = [-a for a in A]
heapify(heap)

for _ in range(M):
    heappushpop(heap, (-1 * heap[0] // 2) * -1)

print(-1 * sum(heap))
