f = lambda:list(map(int,input().split()))

_,m = f()

l = list([-x for x in f()])

import heapq as hq

hq.heapify(l)

for i in range(m):

  p = -hq.heappop(l)//2

  hq.heappush(l,-p)

print((-sum(l)))
f=lambda:input().split()

_,m=list(map(int,f()))

l=[-int(i) for i in f()]

from heapq import *

heapify(l)

for _ in range(m):

  heappush(l,-(-heappop(l)//2))

print((-sum(l)))
f = lambda: list(map(int, input().split()))
_, m = f()
l = list([-x for x in f()])
import heapq as hq

hq.heapify(l)
for i in range(m):
    p = -hq.heappop(l) // 2
    hq.heappush(l, -p)
print((-sum(l)))

f = lambda: input().split()
_, m = list(map(int, f()))
l = [-int(i) for i in f()]
from heapq import *

heapify(l)
for _ in range(m):
    heappush(l, -(-heappop(l) // 2))
print((-sum(l)))

-f = lambda: list(map(int, input().split())) -_, m = f() -l = list([-x for x in f()]) -import heapq as hq +f = lambda: input().split() +_, m = list(map(int, f())) +l = [-int(i) for i in f()] +from heapq import * -hq.heapify(l) -for i in range(m): -    p = -hq.heappop(l) // 2 -    hq.heappush(l, -p) +heapify(l) +for _ in range(m): +    heappush(l, -(-heappop(l) // 2))