import sys

import heapq

from bisect import insort_right

input = sys.stdin.readline

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

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

A = [-a for a in A]

heapq.heapify(A)

  

for i in range(M):

  tmp = heapq.heappop(A)

  heapq.heappush(A,int(tmp/2))

print((sum([-a for a in A])))
from heapq import heapify,heappush,heappop

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

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

heapify(A)

for i in range(M):

  tmp = heappop(A)

  heappush(A,-((-tmp)//2))

A = list(A)



print((-sum(A)))

import sys
import heapq
from bisect import insort_right

input = sys.stdin.readline
N, M = list(map(int, input().split()))
A = list(map(int, input().split()))
A = [-a for a in A]
heapq.heapify(A)
for i in range(M):
    tmp = heapq.heappop(A)
    heapq.heappush(A, int(tmp / 2))
print((sum([-a for a in A])))

from heapq import heapify, heappush, heappop

N, M = list(map(int, input().split()))
A = list([-int(x) for x in input().split()])
heapify(A)
for i in range(M):
    tmp = heappop(A)
    heappush(A, -((-tmp) // 2))
A = list(A)
print((-sum(A)))

-import sys -import heapq -from bisect import insort_right +from heapq import heapify, heappush, heappop -input = sys.stdin.readline -A = list(map(int, input().split())) -A = [-a for a in A] -heapq.heapify(A) +A = list([-int(x) for x in input().split()]) +heapify(A) -    tmp = heapq.heappop(A) -    heapq.heappush(A, int(tmp / 2)) -print((sum([-a for a in A]))) +    tmp = heappop(A) +    heappush(A, -((-tmp) // 2)) +A = list(A) +print((-sum(A)))