import heapq

import math



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

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

q = []

heapq.heapify(q)



for i in range(n):

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



for _ in range(m):

    b = heapq.heappop(q) / 2

    heapq.heappush(q, math.ceil(b))



print((sum(q) * -1))

import sys

from heapq import heapify, heappop, heappush



sys.setrecursionlimit(10 ** 7)

input = sys.stdin.readline

f_inf = float('inf')

mod = 10 ** 9 + 7





def resolve():

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

    A = list([int(x) * (-1) for x in input().split()])

    heapify(A)

    for _ in range(m):

        a = (heappop(A) * (-1)) // 2

        heappush(A, a * (-1))



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





if __name__ == '__main__':

    resolve()

import heapq
import math

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

import sys
from heapq import heapify, heappop, heappush

sys.setrecursionlimit(10**7)
input = sys.stdin.readline
f_inf = float("inf")
mod = 10**9 + 7


def resolve():
    n, m = list(map(int, input().split()))
    A = list([int(x) * (-1) for x in input().split()])
    heapify(A)
    for _ in range(m):
        a = (heappop(A) * (-1)) // 2
        heappush(A, a * (-1))
    print((sum(A) * (-1)))


if __name__ == "__main__":
    resolve()

-import heapq -import math +import sys +from heapq import heapify, heappop, heappush -n, m = list(map(int, input().split())) -a = list(map(int, input().split())) -q = [] -heapq.heapify(q) -for i in range(n): -    heapq.heappush(q, -a[i]) -for _ in range(m): -    b = heapq.heappop(q) / 2 -    heapq.heappush(q, math.ceil(b)) -print((sum(q) * -1)) +sys.setrecursionlimit(10**7) +input = sys.stdin.readline +f_inf = float("inf") +mod = 10**9 + 7 + + +def resolve(): +    n, m = list(map(int, input().split())) +    A = list([int(x) * (-1) for x in input().split()]) +    heapify(A) +    for _ in range(m): +        a = (heappop(A) * (-1)) // 2 +        heappush(A, a * (-1)) +    print((sum(A) * (-1))) + + +if __name__ == "__main__": +    resolve()