import heapq



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

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



heapq.heapify(A)



while M>0:

    a=heapq.heappop(A)

    a=-a

    a=a>>1

    a=-a

    heapq.heappush(A,a)



    M-=1

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



n,m=list(map(int,input().split()))

*a,=list(map(int,input().split()))



q=[]

for aa in a:

    heapq.heappush(q,-aa)



while m>0:

    aa=heapq.heappop(q)

    heapq.heappush(q,-((-aa)//2))

    m-=1



print((-sum(q)))
import heapq

N, M = list(map(int, input().split()))
A = list([-int(x) for x in input().split()])
heapq.heapify(A)
while M > 0:
    a = heapq.heappop(A)
    a = -a
    a = a >> 1
    a = -a
    heapq.heappush(A, a)
    M -= 1
print((-sum(A)))

import heapq

n, m = list(map(int, input().split()))
(*a,) = list(map(int, input().split()))
q = []
for aa in a:
    heapq.heappush(q, -aa)
while m > 0:
    aa = heapq.heappop(q)
    heapq.heappush(q, -((-aa) // 2))
    m -= 1
print((-sum(q)))

-N, M = list(map(int, input().split())) -A = list([-int(x) for x in input().split()]) -heapq.heapify(A) -while M > 0: -    a = heapq.heappop(A) -    a = -a -    a = a >> 1 -    a = -a -    heapq.heappush(A, a) -    M -= 1 -print((-sum(A))) +n, m = list(map(int, input().split())) +(*a,) = list(map(int, input().split())) +q = [] +for aa in a: +    heapq.heappush(q, -aa) +while m > 0: +    aa = heapq.heappop(q) +    heapq.heappush(q, -((-aa) // 2)) +    m -= 1 +print((-sum(q)))