import sys

from math import floor

from heapq import heappush, heappop, heappushpop

input = sys.stdin.readline

sys.setrecursionlimit(10**7)





# 10**5

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

# 10**9

a = sorted([-int(s) for s in input().split()])





for _ in range(m):

    x = heappop(a)

    heappush(a, x/2)



print((sum([floor(-x) for x in a])))

import heapq

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

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

heapq.heapify(A)



for _ in range(m):

    x = heapq.heappop(A)*(-1)

    x //= 2

    heapq.heappush(A, -x)

print((-sum(A)))



import sys
from math import floor
from heapq import heappush, heappop, heappushpop

input = sys.stdin.readline
sys.setrecursionlimit(10**7)
# 10**5
n, m = list(map(int, input().split()))
# 10**9
a = sorted([-int(s) for s in input().split()])
for _ in range(m):
    x = heappop(a)
    heappush(a, x / 2)
print((sum([floor(-x) for x in a])))

import heapq

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

-import sys -from math import floor -from heapq import heappush, heappop, heappushpop +import heapq -input = sys.stdin.readline -sys.setrecursionlimit(10**7) -# 10**5 -# 10**9 -a = sorted([-int(s) for s in input().split()]) +A = list([-int(x) for x in input().split()]) +heapq.heapify(A) -    x = heappop(a) -    heappush(a, x / 2) -print((sum([floor(-x) for x in a]))) +    x = heapq.heappop(A) * (-1) +    x //= 2 +    heapq.heappush(A, -x) +print((-sum(A)))