import sys

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

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

temp = 0

cnt = 0

loop = 0

debug = 0

if n == 1:

    for i in range(m):

        lst_a[0] //= 2

    print((lst_a[0]))

    sys.exit()

while debug < 10:

    loop = 0

    temp = 0

    lst_a.sort(reverse=True)

    while loop < n-1:

        lst_a[loop] //= 2

        cnt += 1

        temp = max(temp,lst_a[loop])

        if cnt == m:

            print((sum(lst_a)))

            sys.exit()

        if temp > max(lst_a[loop],lst_a[loop + 1]):

            break

        if lst_a[loop + 1] > lst_a[loop]:

            loop += 1

        

        
import heapq

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

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

for i in range(n):

    a[i] = -a[i]

heapq.heapify(a)

ans = 0

for i in range(m):

    temp = (heapq.heappop(a)+1)//2

    heapq.heappush(a,temp)

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

n, m = list(map(int, input().split()))
lst_a = list(map(int, input().split()))
temp = 0
cnt = 0
loop = 0
debug = 0
if n == 1:
    for i in range(m):
        lst_a[0] //= 2
    print((lst_a[0]))
    sys.exit()
while debug < 10:
    loop = 0
    temp = 0
    lst_a.sort(reverse=True)
    while loop < n - 1:
        lst_a[loop] //= 2
        cnt += 1
        temp = max(temp, lst_a[loop])
        if cnt == m:
            print((sum(lst_a)))
            sys.exit()
        if temp > max(lst_a[loop], lst_a[loop + 1]):
            break
        if lst_a[loop + 1] > lst_a[loop]:
            loop += 1

import heapq

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

-import sys +import heapq -lst_a = list(map(int, input().split())) -temp = 0 -cnt = 0 -loop = 0 -debug = 0 -if n == 1: -    for i in range(m): -        lst_a[0] //= 2 -    print((lst_a[0])) -    sys.exit() -while debug < 10: -    loop = 0 -    temp = 0 -    lst_a.sort(reverse=True) -    while loop < n - 1: -        lst_a[loop] //= 2 -        cnt += 1 -        temp = max(temp, lst_a[loop]) -        if cnt == m: -            print((sum(lst_a))) -            sys.exit() -        if temp > max(lst_a[loop], lst_a[loop + 1]): -            break -        if lst_a[loop + 1] > lst_a[loop]: -            loop += 1 +a = list(map(int, input().split())) +for i in range(n): +    a[i] = -a[i] +heapq.heapify(a) +ans = 0 +for i in range(m): +    temp = (heapq.heappop(a) + 1) // 2 +    heapq.heappush(a, temp) +print((-sum(a)))