import heapq
N,M = map(int,input().split())
A = list(map(int,input().split()))
heap = []
for i in range(N):
    heapq.heappush(heap,-A[i])
for _ in range(M):
    a = heapq.heappop(heap)
    a = -a
    a = a//2
    heapq.heappush(heap,-a)
print(-sum(heap)) 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(int,input().split())) A list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split heap = [] heap [] for i in range(N):
    heapq.heappush(heap,-A[i]) i range(N) range N heapq.heappush(heap,-A[i]) heapq.heappush heapq heappush heap -A[i] A[i] A i for _ in range(M):
    a = heapq.heappop(heap)
    a = -a
    a = a//2
    heapq.heappush(heap,-a) _ range(M) range M a = heapq.heappop(heap) a heapq.heappop(heap) heapq.heappop heapq heappop heap a = -a a -a a a = a//2 a a//2 a 2 heapq.heappush(heap,-a) heapq.heappush heapq heappush heap -a a print(-sum(heap)) print -sum(heap) sum(heap) sum heap a = -a -a a a = a//2 a//2 a N,M = map(int,input().split()) map(int,input().split()) N A = list(map(int,input().split())) list(map(int,input().split())) A heap = [] [] heap a = heapq.heappop(heap) heapq.heappop(heap) a M = map(int,input().split()) map(int,input().split()) M
import heapq
N,M = map(int,input().split())
A = list(map(int,input().split()))
heap = []
for i in range(N):
    heapq.heappush(heap,-A[i])
for _ in range(M):
    a = heapq.heappop(heap)
    a = -a
    a = a//2
    heapq.heappush(heap,-a)
print(-sum(heap))