import heapq



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

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



heapq.heapify(a)

for i in range(m):

 max=-heapq.heappop(a)

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



print((-sum(a)))
from sys import stdin

nii=lambda:list(map(int,stdin.readline().split()))

lnii=lambda:list(map(int,stdin.readline().split()))

from heapq import *



n,m=nii()

a=lnii()

a=[-i for i in a]

a.sort(reverse=True)



heapify(a)



for i in range(m):

  x=heappop(a)

  x*=-1

  x//=2

  heappush(a,-x)



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

n, m = list(map(int, input().split()))
a = [-int(i) for i in input().split()]
heapq.heapify(a)
for i in range(m):
    max = -heapq.heappop(a)
    heapq.heappush(a, -1 * (max // 2))
print((-sum(a)))

from sys import stdin

nii = lambda: list(map(int, stdin.readline().split()))
lnii = lambda: list(map(int, stdin.readline().split()))
from heapq import *

n, m = nii()
a = lnii()
a = [-i for i in a]
a.sort(reverse=True)
heapify(a)
for i in range(m):
    x = heappop(a)
    x *= -1
    x //= 2
    heappush(a, -x)
print((-sum(a)))

-import heapq +from sys import stdin -n, m = list(map(int, input().split())) -a = [-int(i) for i in input().split()] -heapq.heapify(a) +nii = lambda: list(map(int, stdin.readline().split())) +lnii = lambda: list(map(int, stdin.readline().split())) +from heapq import * + +n, m = nii() +a = lnii() +a = [-i for i in a] +a.sort(reverse=True) +heapify(a) -    max = -heapq.heappop(a) -    heapq.heappush(a, -1 * (max // 2)) +    x = heappop(a) +    x *= -1 +    x //= 2 +    heappush(a, -x)