import heapq

n,m = map(int,input().split())
prod = list(map(int,input().split()))
prod = list(map(lambda x: x*(-1),prod))

heapq.heapify(prod)

for _ in range(m):
    a = heapq.heappop(prod)*(-1)

    a = a//2

    heapq.heappush(prod,(-1)*a)


ans = list(map(lambda x: (-1)*x,prod))

print(sum(ans)) import heapq heapq n,m = map(int,input().split()) n map(int,input().split()) map int input().split() ().split () input split m prod = list(map(int,input().split())) prod list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split prod = list(map(lambda x: x*(-1),prod)) prod list(map(lambda x: x*(-1),prod)) list map(lambda x: x*(-1),prod) map lambda x: x*(-1) x*(-1) x -1 x prod heapq.heapify(prod) heapq.heapify heapq heapify prod for _ in range(m):
    a = heapq.heappop(prod)*(-1)

    a = a//2

    heapq.heappush(prod,(-1)*a) _ range(m) range m a = heapq.heappop(prod)*(-1) a heapq.heappop(prod)*(-1) heapq.heappop(prod) heapq.heappop heapq heappop prod -1 a = a//2 a a//2 a 2 heapq.heappush(prod,(-1)*a) heapq.heappush heapq heappush prod (-1)*a -1 a ans = list(map(lambda x: (-1)*x,prod)) ans list(map(lambda x: (-1)*x,prod)) list map(lambda x: (-1)*x,prod) map lambda x: (-1)*x (-1)*x -1 x x prod print(sum(ans)) print sum(ans) sum ans a = a//2 a//2 a m = map(int,input().split()) map(int,input().split()) m n,m = map(int,input().split()) map(int,input().split()) n a = heapq.heappop(prod)*(-1) heapq.heappop(prod)*(-1) a prod = list(map(int,input().split())) list(map(int,input().split())) prod prod = list(map(lambda x: x*(-1),prod)) list(map(lambda x: x*(-1),prod)) prod ans = list(map(lambda x: (-1)*x,prod)) list(map(lambda x: (-1)*x,prod)) ans
import heapq

n,m = map(int,input().split())
prod = list(map(int,input().split()))
prod = list(map(lambda x: x*(-1),prod))

heapq.heapify(prod)

for _ in range(m):
    a = heapq.heappop(prod)*(-1)

    a = a//2

    heapq.heappush(prod,(-1)*a)


ans = list(map(lambda x: (-1)*x,prod))

print(sum(ans))