import sys

import heapq



input = sys.stdin.readline

 

N, M =  list(map(int, input().split()))

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



A = list([x * (-1) for x in A])

heapq.heapify(A)



for _ in range(M):

    mx = heapq.heappop(A)

    heapq.heappush(A, mx // 2 if mx % 2 == 0 else mx // 2 + 1)



print((sum(A) * (-1)))
import sys

import heapq



input = sys.stdin.readline

 

N, M =  list(map(int, input().split()))

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



#A = list(map(lambda x: x * (-1), A))

A = [-i for i in A]

heapq.heapify(A)



for _ in range(M):

    mx = heapq.heappop(A)

    heapq.heappush(A, mx // 2 if mx % 2 == 0 else mx // 2 + 1)



print((sum(A) * (-1)))
import sys
import heapq

input = sys.stdin.readline
N, M = list(map(int, input().split()))
A = list(map(int, input().split()))
A = list([x * (-1) for x in A])
heapq.heapify(A)
for _ in range(M):
    mx = heapq.heappop(A)
    heapq.heappush(A, mx // 2 if mx % 2 == 0 else mx // 2 + 1)
print((sum(A) * (-1)))

import sys
import heapq

input = sys.stdin.readline
N, M = list(map(int, input().split()))
A = list(map(int, input().split()))
# A = list(map(lambda x: x * (-1), A))
A = [-i for i in A]
heapq.heapify(A)
for _ in range(M):
    mx = heapq.heappop(A)
    heapq.heappush(A, mx // 2 if mx % 2 == 0 else mx // 2 + 1)
print((sum(A) * (-1)))

-A = list([x * (-1) for x in A]) +# A = list(map(lambda x: x * (-1), A)) +A = [-i for i in A]