from math import ceil

from heapq import *



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

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

heapify(a_s)



for _ in range(m):

	amax = heappop(a_s)

	heappush(a_s, ceil(amax / 2))



res = sum([-heappop(a_s) for _ in range(n)])

print(res)
from math import ceil

from heapq import *



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

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

heapify(a_s)



for _ in range(m):

	amax = -heappop(a_s)

	heappush(a_s, -(amax // 2))



res = -sum(a_s)

print(res)

from math import ceil
from heapq import *

n, m = list(map(int, input().split()))
a_s = [-int(a) for a in input().split()]
heapify(a_s)
for _ in range(m):
    amax = heappop(a_s)
    heappush(a_s, ceil(amax / 2))
res = sum([-heappop(a_s) for _ in range(n)])
print(res)

from math import ceil
from heapq import *

n, m = list(map(int, input().split()))
a_s = [-int(a) for a in input().split()]
heapify(a_s)
for _ in range(m):
    amax = -heappop(a_s)
    heappush(a_s, -(amax // 2))
res = -sum(a_s)
print(res)

-    amax = heappop(a_s) -    heappush(a_s, ceil(amax / 2)) -res = sum([-heappop(a_s) for _ in range(n)]) +    amax = -heappop(a_s) +    heappush(a_s, -(amax // 2)) +res = -sum(a_s)