import heapq

N,M=[int(s) for s in input().split()]

ls=[int(s) for s in input().split()]

h = []

for e in ls:

  heapq.heappush(h, (-e,e))

for i in range(M):

  x=heapq.heappop(h)

  y=x[1]//2

  heapq.heappush(h,(-y,y))

ls2=[e[1] for e in h]

print((sum(ls2)))

import heapq

N,M=[int(s) for s in input().split()]

ls=input().split()

h = []

for e in ls:

  heapq.heappush(h, -int(e))

for i in range(M):

  x=heapq.heappop(h)

  y=(-x)//2

  heapq.heappush(h,-y)

print((-sum(h)))

import heapq

N, M = [int(s) for s in input().split()]
ls = [int(s) for s in input().split()]
h = []
for e in ls:
    heapq.heappush(h, (-e, e))
for i in range(M):
    x = heapq.heappop(h)
    y = x[1] // 2
    heapq.heappush(h, (-y, y))
ls2 = [e[1] for e in h]
print((sum(ls2)))

import heapq

N, M = [int(s) for s in input().split()]
ls = input().split()
h = []
for e in ls:
    heapq.heappush(h, -int(e))
for i in range(M):
    x = heapq.heappop(h)
    y = (-x) // 2
    heapq.heappush(h, -y)
print((-sum(h)))

-ls = [int(s) for s in input().split()] +ls = input().split() -    heapq.heappush(h, (-e, e)) +    heapq.heappush(h, -int(e)) -    y = x[1] // 2 -    heapq.heappush(h, (-y, y)) -ls2 = [e[1] for e in h] -print((sum(ls2))) +    y = (-x) // 2 +    heapq.heappush(h, -y) +print((-sum(h)))