import heapq
N, M = map(int, input().split())
A = list(map(int, input().split()))
for i in range(N):
    A[i] = -A[i]
heapq.heapify(A)

for i in range(M):
    a = heapq.heappop(A)*(-1)
    if a ==0:#最大値が0になったら終了
        break
    a//=2
    heapq.heappush(A, -a)
print(-sum(A)) 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 for i in range(N):
    A[i] = -A[i] i range(N) range N A[i] = -A[i] A[i] A i -A[i] A[i] A i heapq.heapify(A) heapq.heapify heapq heapify A for i in range(M):
    a = heapq.heappop(A)*(-1)
    if a ==0:#最大値が0になったら終了
        break
    a//=2
    heapq.heappush(A, -a) i range(M) range M a = heapq.heappop(A)*(-1) a heapq.heappop(A)*(-1) heapq.heappop(A) heapq.heappop heapq heappop A -1 if a ==0:#最大値が0になったら終了
        break
     a ==0 a 0 break a//=2 a 2 heapq.heappush(A, -a) heapq.heappush heapq heappush A -a a print(-sum(A)) print -sum(A) sum(A) sum A A = list(map(int, input().split())) list(map(int, input().split())) A a//=2 2 a a = heapq.heappop(A)*(-1) heapq.heappop(A)*(-1) a N, M = map(int, input().split()) map(int, input().split()) N M = map(int, input().split()) map(int, input().split()) M
import heapq
N, M = map(int, input().split())
A = list(map(int, input().split()))
for i in range(N):
    A[i] = -A[i]
heapq.heapify(A)

for i in range(M):
    a = heapq.heappop(A)*(-1)
    if a ==0:#最大値が0になったら終了
        break
    a//=2
    heapq.heappush(A, -a)
print(-sum(A))