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

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

import heapq

heapq.heapify(li)

for i in range(b):

    c = heapq.heappop(li)

    heapq.heappush(li,c/2)

li = [int(x) for x in li]

print((-sum(li)))
import heapq

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

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

L = [-x for x in L]



heapq.heapify(L)

for i in range(b):

    a =heapq.heappop(L)

    a= -(-a//2)

    heapq.heappush(L,a)



L = [-x for x in L]

print((sum(L)))
a, b = list(map(int, input().split()))
li = [-int(x) for x in input().split()]
import heapq

heapq.heapify(li)
for i in range(b):
    c = heapq.heappop(li)
    heapq.heappush(li, c / 2)
li = [int(x) for x in li]
print((-sum(li)))

import heapq

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

-a, b = list(map(int, input().split())) -li = [-int(x) for x in input().split()] -heapq.heapify(li) +a, b = list(map(int, input().split())) +L = list(map(int, input().split())) +L = [-x for x in L] +heapq.heapify(L) -    c = heapq.heappop(li) -    heapq.heappush(li, c / 2) -li = [int(x) for x in li] -print((-sum(li))) +    a = heapq.heappop(L) +    a = -(-a // 2) +    heapq.heappush(L, a) +L = [-x for x in L] +print((sum(L)))