import heapq	



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

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

hq=[]

for i in range(len(a)):

  heapq.heappush(hq,-a[i])



if n==1:

  for i in range(m):

    hq[0]=(((-1)*hq[0])//2)*(-1)

else:

  for i in range(m):

    v=heapq.heappop(hq)

    heapq.heappush(hq,((v*-1)//2)*(-1))



ans=0

for i in range(len(hq)):

  ans=ans+(-1)*heapq.heappop(hq)



print(ans)

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

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

for i in range(len(a)):

  a[i]*=(-1)



import heapq

heapq.heapify(a)



for i in range(m):

  val=heapq.heappop(a)

  heapq.heappush(a,((val*(-1))//2)*(-1))



print((sum(a)*(-1)))
import heapq

n, m = list(map(int, input().split()))
a = list(map(int, input().split()))
hq = []
for i in range(len(a)):
    heapq.heappush(hq, -a[i])
if n == 1:
    for i in range(m):
        hq[0] = (((-1) * hq[0]) // 2) * (-1)
else:
    for i in range(m):
        v = heapq.heappop(hq)
        heapq.heappush(hq, ((v * -1) // 2) * (-1))
ans = 0
for i in range(len(hq)):
    ans = ans + (-1) * heapq.heappop(hq)
print(ans)

n, m = list(map(int, input().split()))
a = list(map(int, input().split()))
for i in range(len(a)):
    a[i] *= -1
import heapq

heapq.heapify(a)
for i in range(m):
    val = heapq.heappop(a)
    heapq.heappush(a, ((val * (-1)) // 2) * (-1))
print((sum(a) * (-1)))

+n, m = list(map(int, input().split())) +a = list(map(int, input().split())) +for i in range(len(a)): +    a[i] *= -1 -n, m = list(map(int, input().split())) -a = list(map(int, input().split())) -hq = [] -for i in range(len(a)): -    heapq.heappush(hq, -a[i]) -if n == 1: -    for i in range(m): -        hq[0] = (((-1) * hq[0]) // 2) * (-1) -else: -    for i in range(m): -        v = heapq.heappop(hq) -        heapq.heappush(hq, ((v * -1) // 2) * (-1)) -ans = 0 -for i in range(len(hq)): -    ans = ans + (-1) * heapq.heappop(hq) -print(ans) +heapq.heapify(a) +for i in range(m): +    val = heapq.heappop(a) +    heapq.heappush(a, ((val * (-1)) // 2) * (-1)) +print((sum(a) * (-1)))