import heapq

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

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

A=list([-x for x in A])

heapq.heapify(A)

for i in range(M):

  heapq.heappush(A, (heapq.heappop(A)+1)//2)

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



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

A=list([x*(-1) for x in list(map(int, input().split()))])

heapq.heapify(A)

for i in range(M):

    a=heapq.heappop(A)

    a=((a*(-1))//2)*(-1)

    heapq.heappush(A, a)

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

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

import heapq

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

-A = list(map(int, input().split())) -A = list([-x for x in A]) +A = list([x * (-1) for x in list(map(int, input().split()))]) -    heapq.heappush(A, (heapq.heappop(A) + 1) // 2) +    a = heapq.heappop(A) +    a = ((a * (-1)) // 2) * (-1) +    heapq.heappush(A, a)