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

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

A = [x * -1 for x in A]

A.sort()

import heapq

import bisect

heapq.heapify(A)

for _ in range(m):

    min_ = heapq.heappop(A)

    tmp = min_ * -1 // 2 * -1

    index = bisect.bisect_left(A, tmp)

    heapq.heappush(A,tmp)

print((sum(A) * -1))

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

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

import heapq

heapq.heapify(A)

for _ in range(m):

    min_ = heapq.heappop(A)

    tmp = min_ * -1 // 2 * -1

    heapq.heappush(A,tmp)

print((sum(A) * -1))

n, m = list(map(int, input().split()))
A = list(map(int, input().split()))
A = [x * -1 for x in A]
A.sort()
import heapq
import bisect

heapq.heapify(A)
for _ in range(m):
    min_ = heapq.heappop(A)
    tmp = min_ * -1 // 2 * -1
    index = bisect.bisect_left(A, tmp)
    heapq.heappush(A, tmp)
print((sum(A) * -1))

n, m = list(map(int, input().split()))
A = [x * -1 for x in list(map(int, input().split()))]
import heapq

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

-A = list(map(int, input().split())) -A = [x * -1 for x in A] -A.sort() +A = [x * -1 for x in list(map(int, input().split()))] -import bisect -    index = bisect.bisect_left(A, tmp)