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