from math import ceil

import heapq



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

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

A = [-a for a in tmpA]

heapq.heapify(A)



for _ in range(M):

    a = heapq.heappop(A)

    heapq.heappush(A, ceil(a / 2))



print((-sum(A)))

from math import ceil

import heapq



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

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

heapq.heapify(A)



for _ in range(M):

    a = heapq.heappop(A)

    heapq.heappush(A, ceil(a / 2))



print((-sum(A)))

from math import ceil
import heapq

N, M = list(map(int, input().split()))
tmpA = list(map(int, input().split()))
A = [-a for a in tmpA]
heapq.heapify(A)
for _ in range(M):
    a = heapq.heappop(A)
    heapq.heappush(A, ceil(a / 2))
print((-sum(A)))

from math import ceil
import heapq

N, M = list(map(int, input().split()))
A = [-int(a) for a in input().split()]
heapq.heapify(A)
for _ in range(M):
    a = heapq.heappop(A)
    heapq.heappush(A, ceil(a / 2))
print((-sum(A)))

-tmpA = list(map(int, input().split())) -A = [-a for a in tmpA] +A = [-int(a) for a in input().split()]