import heapq

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

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

A = [-A[i] for i in range(N)]

A = sorted(A)

cnt = 0

while cnt<M:

    a = heapq.heappop(A)*(-1)

    a = a/2

    heapq.heappush(A,-a)

    cnt += 1

A = [int(-A[i]) for i in range(N)]

print((sum(A)))
import heapq

N,M = list(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

N, M = list(map(int, input().split()))
A = list(map(int, input().split()))
A = [-A[i] for i in range(N)]
A = sorted(A)
cnt = 0
while cnt < M:
    a = heapq.heappop(A) * (-1)
    a = a / 2
    heapq.heappush(A, -a)
    cnt += 1
A = [int(-A[i]) for i in range(N)]
print((sum(A)))

import heapq

N, M = list(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)))

-A = [-A[i] for i in range(N)] -A = sorted(A) -cnt = 0 -while cnt < M: -    a = heapq.heappop(A) * (-1) -    a = a / 2 -    heapq.heappush(A, -a) -    cnt += 1 -A = [int(-A[i]) for i in range(N)] -print((sum(A))) +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)))