import heapq
N,M=map(int,input().split())
a=list(map(int,input().split()))
a = list(map(lambda x: x * (-1), a))  # 各要素を-1倍
heapq.heapify(a)  # リストを優先度付きキューへ
for _ in range(M):
    number=heapq.heappop(a)  # 最大値の取り出し
    if number%2==0:
        number=number//2
    else:
        number=number//2+1
    heapq.heappush(a, number)  # 要素の挿入
print(-sum(a)) import heapq heapq N,M=map(int,input().split()) N map(int,input().split()) map int input().split() ().split () input split M a=list(map(int,input().split())) a list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split a = list(map(lambda x: x * (-1), a)) a list(map(lambda x: x * (-1), a)) list map(lambda x: x * (-1), a) map lambda x: x * (-1) x * (-1) x -1 x a heapq.heapify(a) heapq.heapify heapq heapify a for _ in range(M):
    number=heapq.heappop(a)  # 最大値の取り出し
    if number%2==0:
        number=number//2
    else:
        number=number//2+1
    heapq.heappush(a, number)  # 要素の挿入 _ range(M) range M number=heapq.heappop(a) number heapq.heappop(a) heapq.heappop heapq heappop a if number%2==0:
        number=number//2
    else:
        number=number//2+1
     number%2==0 number%2 number 2 0 number=number//2 number number//2 number 2 number=number//2+1 number number//2+1 number//2 number 2 1 heapq.heappush(a, number) heapq.heappush heapq heappush a number print(-sum(a)) print -sum(a) sum(a) sum a number=number//2 number//2 number M=map(int,input().split()) map(int,input().split()) M a = list(map(lambda x: x * (-1), a)) list(map(lambda x: x * (-1), a)) a number=heapq.heappop(a) heapq.heappop(a) number N,M=map(int,input().split()) map(int,input().split()) N a=list(map(int,input().split())) list(map(int,input().split())) a number=number//2+1 number//2+1 number
import heapq
N,M=map(int,input().split())
a=list(map(int,input().split()))
a = list(map(lambda x: x * (-1), a))  # 各要素を-1倍
heapq.heapify(a)  # リストを優先度付きキューへ
for _ in range(M):
    number=heapq.heappop(a)  # 最大値の取り出し
    if number%2==0:
        number=number//2
    else:
        number=number//2+1
    heapq.heappush(a, number)  # 要素の挿入
print(-sum(a))
