from heapq import heappop,heappush,heapify

import sys

input = sys.stdin.readline

sys.setrecursionlimit(10 ** 7) 

 

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

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

 

a_minus = [-x for x in a]

heapify(a_minus)

 

pop = lambda: -heappop(a_minus)

push = lambda x: heappush(a_minus,-x)

 

for _ in range(m):

    x = pop()

    push(x//2)

 

print((-sum(a_minus)))
import heapq



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

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

heapq.heapify(a)

for i in range(m):

    tmp_min=heapq.heappop(a)

    heapq.heappush(a,(-1)*(-1*tmp_min//2))  # 計算誤差の関係で-1を2回かけてます

print((-sum(a)))

from heapq import heappop, heappush, heapify
import sys

input = sys.stdin.readline
sys.setrecursionlimit(10**7)
n, m = list(map(int, input().split()))
a = [int(x) for x in input().split()]
a_minus = [-x for x in a]
heapify(a_minus)
pop = lambda: -heappop(a_minus)
push = lambda x: heappush(a_minus, -x)
for _ in range(m):
    x = pop()
    push(x // 2)
print((-sum(a_minus)))

import heapq

n, m = list(map(int, input().split()))
a = list([int(x) * (-1) for x in input().split()])
heapq.heapify(a)
for i in range(m):
    tmp_min = heapq.heappop(a)
    heapq.heappush(a, (-1) * (-1 * tmp_min // 2))  # 計算誤差の関係で-1を2回かけてます
print((-sum(a)))

-from heapq import heappop, heappush, heapify -import sys +import heapq -input = sys.stdin.readline -sys.setrecursionlimit(10**7) -a = [int(x) for x in input().split()] -a_minus = [-x for x in a] -heapify(a_minus) -pop = lambda: -heappop(a_minus) -push = lambda x: heappush(a_minus, -x) -for _ in range(m): -    x = pop() -    push(x // 2) -print((-sum(a_minus))) +a = list([int(x) * (-1) for x in input().split()]) +heapq.heapify(a) +for i in range(m): +    tmp_min = heapq.heappop(a) +    heapq.heappush(a, (-1) * (-1 * tmp_min // 2))  # 計算誤差の関係で-1を2回かけてます +print((-sum(a)))