import bisect

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

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

for _ in range(M):

    x = A.pop()

    y = x // 2

    i = bisect.bisect_left(A, y)

    A.insert(i, y)

ans = sum(A)

print(ans)
import heapq

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

A = [-a for a in map(int, input().split())]

heapq.heapify(A)

for _ in range(M):

    x = -heapq.heappop(A)

    heapq.heappush(A, -(x // 2))

ans = -sum(A)

print(ans)
import bisect

N, M = list(map(int, input().split()))
A = sorted(map(int, input().split()))
for _ in range(M):
    x = A.pop()
    y = x // 2
    i = bisect.bisect_left(A, y)
    A.insert(i, y)
ans = sum(A)
print(ans)

import heapq

N, M = list(map(int, input().split()))
A = [-a for a in map(int, input().split())]
heapq.heapify(A)
for _ in range(M):
    x = -heapq.heappop(A)
    heapq.heappush(A, -(x // 2))
ans = -sum(A)
print(ans)

-import bisect +import heapq -A = sorted(map(int, input().split())) +A = [-a for a in map(int, input().split())] +heapq.heapify(A) -    x = A.pop() -    y = x // 2 -    i = bisect.bisect_left(A, y) -    A.insert(i, y) -ans = sum(A) +    x = -heapq.heappop(A) +    heapq.heappush(A, -(x // 2)) +ans = -sum(A)