import heapq

import math



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

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

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



heapq.heapify(b)

for i in range(m):

    h = heapq.heappop(b)

    heapq.heappush(b, math.ceil(h / 2))



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



print((sum(c)))

import heapq

import math

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

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

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



heapq.heapify(b)

for i in range(m):

    h = heapq.heappop(b)

    heapq.heappush(b, math.ceil(h / 2))



print((sum(b)*(-1)))
import heapq
import math

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

import heapq
import math

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

-c = list([x * (-1) for x in b]) -print((sum(c))) +print((sum(b) * (-1)))