import heapq

import math



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

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



a = [-1*num for num in a]



heapq.heapify(a)



for i in range(m):

	maximum = heapq.heappop(a)

	add = math.trunc(maximum/2)

	heapq.heappush(a,add)



print((-1 * sum(a)))

import heapq



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

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



a = [-1*i for i in a]



heapq.heapify(a)



for i in range(m):

	max_a = -1 * heapq.heappop(a)

	heapq.heappush(a,-1 *(max_a // 2))



print((-1 * sum(a)))

import heapq
import math

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

import heapq

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

-import math -a = [-1 * num for num in a] +a = [-1 * i for i in a] -    maximum = heapq.heappop(a) -    add = math.trunc(maximum / 2) -    heapq.heappush(a, add) +    max_a = -1 * heapq.heappop(a) +    heapq.heappush(a, -1 * (max_a // 2))