import heapq



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

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

prod = list([x*(-1) for x in prod])



heapq.heapify(prod)



for _ in range(m):

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



    a = a//2



    heapq.heappush(prod,(-1)*a)





ans = list([(-1)*x for x in prod])



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

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



for i in range(n):

    a[i]*=-1



import heapq,math



heapq.heapify(a)



for _ in range(m):

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

    b //=2



    heapq.heappush(a,b*(-1))



print((sum(a)*(-1)))
import heapq

n, m = list(map(int, input().split()))
prod = list(map(int, input().split()))
prod = list([x * (-1) for x in prod])
heapq.heapify(prod)
for _ in range(m):
    a = heapq.heappop(prod) * (-1)
    a = a // 2
    heapq.heappush(prod, (-1) * a)
ans = list([(-1) * x for x in prod])
print((sum(ans)))

n, m = list(map(int, input().split()))
a = list(map(int, input().split()))
for i in range(n):
    a[i] *= -1
import heapq, math

heapq.heapify(a)
for _ in range(m):
    b = heapq.heappop(a) * (-1)
    b //= 2
    heapq.heappush(a, b * (-1))
print((sum(a) * (-1)))

-import heapq +n, m = list(map(int, input().split())) +a = list(map(int, input().split())) +for i in range(n): +    a[i] *= -1 +import heapq, math -n, m = list(map(int, input().split())) -prod = list(map(int, input().split())) -prod = list([x * (-1) for x in prod]) -heapq.heapify(prod) +heapq.heapify(a) -    a = heapq.heappop(prod) * (-1) -    a = a // 2 -    heapq.heappush(prod, (-1) * a) -ans = list([(-1) * x for x in prod]) -print((sum(ans))) +    b = heapq.heappop(a) * (-1) +    b //= 2 +    heapq.heappush(a, b * (-1)) +print((sum(a) * (-1)))