import heapq

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

A = list(map(int, input().split()))

A = [-i for i in A]



heapq.heapify(A)

for _ in range(M):

#Hは全部マイナスをつけたからaは最大値的なのはいる

    a = heapq.heappop(A)

    heapq.heappush(A, int(a/2))

print((-sum(A)))
import heapq



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

A = [-int(i) for i in input().split()]



heapq.heapify(A)

for _ in range(M):

    heapq.heapreplace(A, int(A[0]/2))

print((-sum(A)))



import heapq

N, M = list(map(int, input().split()))
A = list(map(int, input().split()))
A = [-i for i in A]
heapq.heapify(A)
for _ in range(M):
    # Hは全部マイナスをつけたからaは最大値的なのはいる
    a = heapq.heappop(A)
    heapq.heappush(A, int(a / 2))
print((-sum(A)))

import heapq

N, M = list(map(int, input().split()))
A = [-int(i) for i in input().split()]
heapq.heapify(A)
for _ in range(M):
    heapq.heapreplace(A, int(A[0] / 2))
print((-sum(A)))

-A = list(map(int, input().split())) -A = [-i for i in A] +A = [-int(i) for i in input().split()] -    # Hは全部マイナスをつけたからaは最大値的なのはいる -    a = heapq.heappop(A) -    heapq.heappush(A, int(a / 2)) +    heapq.heapreplace(A, int(A[0] / 2))