import heapq

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

a=[-int(i) for i in input().split()]

heapq.heapify(a)

for i in range(m):

    b=-heapq.heappop(a)

    heapq.heappush(a,-b/2)

print((int( sum(-i//1 for i in a)) ))


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

a=[-int(aa) for aa in input().split() ]



import heapq

heapq.heapify(a)

for _ in range(m):

    now = -heapq.heappop(a)

    heapq.heappush(a,- (now//2) )

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

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

n, m = list(map(int, input().split()))
a = [-int(aa) for aa in input().split()]
import heapq

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

+n, m = list(map(int, input().split())) +a = [-int(aa) for aa in input().split()] -n, m = list(map(int, input().split())) -a = [-int(i) for i in input().split()] -for i in range(m): -    b = -heapq.heappop(a) -    heapq.heappush(a, -b / 2) -print((int(sum(-i // 1 for i in a)))) +for _ in range(m): +    now = -heapq.heappop(a) +    heapq.heappush(a, -(now // 2)) +print((-sum(a)))