import heapq 

N, M = list(map(int, input().split()))

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

q = []

for a in A:

  q += [-a]

heapq.heapify(q)



for _ in range(M):

  a = heapq.heappop(q)

  heapq.heappush(q, a/2)

ans = 0 

for p in q:

  ans += int(-p)

print(ans)
import heapq

import math

N, M = list(map(int, input().split()))

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

heapq.heapify(A)



while M > 0:

  a = heapq.heappop(A)

  heapq.heappush(A, a/2)

  M -= 1





ans = 0

for a in range(N):

  ans += math.floor(-A[a])



print(ans)

import heapq

N, M = list(map(int, input().split()))
A = list(map(int, input().split()))
q = []
for a in A:
    q += [-a]
heapq.heapify(q)
for _ in range(M):
    a = heapq.heappop(q)
    heapq.heappush(q, a / 2)
ans = 0
for p in q:
    ans += int(-p)
print(ans)

import heapq
import math

N, M = list(map(int, input().split()))
A = list([-int(x) for x in input().split()])
heapq.heapify(A)
while M > 0:
    a = heapq.heappop(A)
    heapq.heappush(A, a / 2)
    M -= 1
ans = 0
for a in range(N):
    ans += math.floor(-A[a])
print(ans)

+import math -A = list(map(int, input().split())) -q = [] -for a in A: -    q += [-a] -heapq.heapify(q) -for _ in range(M): -    a = heapq.heappop(q) -    heapq.heappush(q, a / 2) +A = list([-int(x) for x in input().split()]) +heapq.heapify(A) +while M > 0: +    a = heapq.heappop(A) +    heapq.heappush(A, a / 2) +    M -= 1 -for p in q: -    ans += int(-p) +for a in range(N): +    ans += math.floor(-A[a])