import sys
import heapq


input = sys.stdin.readline
n, m = map(int, input().split())
a_list = list(map(int, input().split()))
a_list = list(map(lambda x: x*(-1), a_list))
heapq.heapify(a_list)

while m > 0:
    max_a = heapq.heappop(a_list)
    heapq.heappush(a_list, (-1)*(-max_a//2))
    m -= 1

print(-sum(a_list)) import sys sys import heapq heapq input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline n, m = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split m a_list = list(map(int, input().split())) a_list list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split a_list = list(map(lambda x: x*(-1), a_list)) a_list list(map(lambda x: x*(-1), a_list)) list map(lambda x: x*(-1), a_list) map lambda x: x*(-1) x*(-1) x -1 x a_list heapq.heapify(a_list) heapq.heapify heapq heapify a_list while m > 0:
    max_a = heapq.heappop(a_list)
    heapq.heappush(a_list, (-1)*(-max_a//2))
    m -= 1 m > 0 m 0 max_a = heapq.heappop(a_list) max_a heapq.heappop(a_list) heapq.heappop heapq heappop a_list heapq.heappush(a_list, (-1)*(-max_a//2)) heapq.heappush heapq heappush a_list (-1)*(-max_a//2) -1 -max_a//2 -max_a max_a 2 m -= 1 m 1 print(-sum(a_list)) print -sum(a_list) sum(a_list) sum a_list m -= 1 1 m n, m = map(int, input().split()) map(int, input().split()) n a_list = list(map(lambda x: x*(-1), a_list)) list(map(lambda x: x*(-1), a_list)) a_list max_a = heapq.heappop(a_list) heapq.heappop(a_list) max_a m = map(int, input().split()) map(int, input().split()) m input = sys.stdin.readline sys.stdin.readline input a_list = list(map(int, input().split())) list(map(int, input().split())) a_list
import sys
import heapq


input = sys.stdin.readline
n, m = map(int, input().split())
a_list = list(map(int, input().split()))
a_list = list(map(lambda x: x*(-1), a_list))
heapq.heapify(a_list)

while m > 0:
    max_a = heapq.heappop(a_list)
    heapq.heappush(a_list, (-1)*(-max_a//2))
    m -= 1

print(-sum(a_list))
