import heapq



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

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



h = [(-a, a) for a in aa]

heapq.heapify(h)

for _ in range(m):

    x = h[0]

    c = x[1] // 2

    x = (-c, c)



    heapq.heapreplace(h, x)



print((sum([-hh[0] for hh in h])))
import heapq



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

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



h = [-a for a in aa]

heapq.heapify(h)

for _ in range(m):

    x = h[0]

    heapq.heapreplace(h, -(-x // 2))



print((sum([-hh for hh in h])))
import heapq

n, m = list(map(int, input().split()))
aa = list(map(int, input().split()))
h = [(-a, a) for a in aa]
heapq.heapify(h)
for _ in range(m):
    x = h[0]
    c = x[1] // 2
    x = (-c, c)
    heapq.heapreplace(h, x)
print((sum([-hh[0] for hh in h])))

import heapq

n, m = list(map(int, input().split()))
aa = list(map(int, input().split()))
h = [-a for a in aa]
heapq.heapify(h)
for _ in range(m):
    x = h[0]
    heapq.heapreplace(h, -(-x // 2))
print((sum([-hh for hh in h])))

-h = [(-a, a) for a in aa] +h = [-a for a in aa] -    c = x[1] // 2 -    x = (-c, c) -    heapq.heapreplace(h, x) -print((sum([-hh[0] for hh in h]))) +    heapq.heapreplace(h, -(-x // 2)) +print((sum([-hh for hh in h])))