import heapq

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

a = list([int(x)*(-1) for x in input().split()])

heapq.heapify(a)

for i in range(M):

    tmp = heapq.heappop(a)

    if tmp % 2 == 0:

        tmp //= 2

    else:

        tmp //= 2

        tmp += 1

    heapq.heappush(a,tmp)

print((sum(a)*(-1)))
N, M = list(map(int, input().split()))

arr = list([int(x)*(-1) for x in input().split()])

import heapq

heapq.heapify(arr)

for _ in range(M):

    tmp = heapq.heappop(arr)

    heapq.heappush(arr,-(-tmp//2))

print((-sum(arr)))
import heapq

N, M = list(map(int, input().split()))
a = list([int(x) * (-1) for x in input().split()])
heapq.heapify(a)
for i in range(M):
    tmp = heapq.heappop(a)
    if tmp % 2 == 0:
        tmp //= 2
    else:
        tmp //= 2
        tmp += 1
    heapq.heappush(a, tmp)
print((sum(a) * (-1)))

N, M = list(map(int, input().split()))
arr = list([int(x) * (-1) for x in input().split()])
import heapq

heapq.heapify(arr)
for _ in range(M):
    tmp = heapq.heappop(arr)
    heapq.heappush(arr, -(-tmp // 2))
print((-sum(arr)))

+N, M = list(map(int, input().split())) +arr = list([int(x) * (-1) for x in input().split()]) -N, M = list(map(int, input().split())) -a = list([int(x) * (-1) for x in input().split()]) -heapq.heapify(a) -for i in range(M): -    tmp = heapq.heappop(a) -    if tmp % 2 == 0: -        tmp //= 2 -    else: -        tmp //= 2 -        tmp += 1 -    heapq.heappush(a, tmp) -print((sum(a) * (-1))) +heapq.heapify(arr) +for _ in range(M): +    tmp = heapq.heappop(arr) +    heapq.heappush(arr, -(-tmp // 2)) +print((-sum(arr)))