from heapq import heappush, heappop

import math

import sys

input = sys.stdin.readline



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

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

Hq = []

for a in A:

  heappush(Hq, -a)

 

for _ in range(m):

  max = -heappop(Hq)

  heappush(Hq, -math.floor(max/2))

print((-sum(Hq)))  
from heapq import *



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

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

heapify(A)



for _ in range(m):

    max_a = heappop(A)*(-1)

    max_a //= 2

    heappush(A, -max_a)

print((-sum(A)))
from heapq import heappush, heappop
import math
import sys

input = sys.stdin.readline
n, m = list(map(int, input().split()))
A = list(map(int, input().split()))
Hq = []
for a in A:
    heappush(Hq, -a)
for _ in range(m):
    max = -heappop(Hq)
    heappush(Hq, -math.floor(max / 2))
print((-sum(Hq)))

from heapq import *

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

-from heapq import heappush, heappop -import math -import sys +from heapq import * -input = sys.stdin.readline -A = list(map(int, input().split())) -Hq = [] -for a in A: -    heappush(Hq, -a) +A = list([int(x) * (-1) for x in input().split()]) +heapify(A) -    max = -heappop(Hq) -    heappush(Hq, -math.floor(max / 2)) -print((-sum(Hq))) +    max_a = heappop(A) * (-1) +    max_a //= 2 +    heappush(A, -max_a) +print((-sum(A)))