from collections import deque
n,m = list(map(int,input().split()))
a = list(map(int,input().split()))

A = deque(sorted(a,reverse=True))
B = deque([])

for _ in range(m):
    #if _ % (m//10) == 0: print(A, B)
    if A:
        if B:
            if (A[0] > B[0]):
                B.append(A.popleft()//2)
                continue
        else:
            B.append(A.popleft()//2)
            continue
    b = B.popleft()
    B.append(b//2)

print(sum(A)+sum(B)) from collections import deque n,m = list(map(int,input().split())) n list(map(int,input().split())) list 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 = deque(sorted(a,reverse=True)) A deque(sorted(a,reverse=True)) deque sorted(a,reverse=True) sorted a reverse=True reverse True B = deque([]) B deque([]) deque [] for _ in range(m):
    #if _ % (m//10) == 0: print(A, B)
    if A:
        if B:
            if (A[0] > B[0]):
                B.append(A.popleft()//2)
                continue
        else:
            B.append(A.popleft()//2)
            continue
    b = B.popleft()
    B.append(b//2) _ range(m) range m if A:
        if B:
            if (A[0] > B[0]):
                B.append(A.popleft()//2)
                continue
        else:
            B.append(A.popleft()//2)
            continue
     A if B:
            if (A[0] > B[0]):
                B.append(A.popleft()//2)
                continue
        else:
            B.append(A.popleft()//2)
            continue
     B if (A[0] > B[0]):
                B.append(A.popleft()//2)
                continue
         A[0] > B[0] A[0] A 0 B[0] B 0 B.append(A.popleft()//2) B.append B append A.popleft()//2 A.popleft() A.popleft A popleft 2 continue B.append(A.popleft()//2) B.append B append A.popleft()//2 A.popleft() A.popleft A popleft 2 continue b = B.popleft() b B.popleft() B.popleft B popleft B.append(b//2) B.append B append b//2 b 2 print(sum(A)+sum(B)) print sum(A)+sum(B) sum(A) sum A sum(B) sum B B = deque([]) deque([]) B m = list(map(int,input().split())) list(map(int,input().split())) m n,m = list(map(int,input().split())) list(map(int,input().split())) n b = B.popleft() B.popleft() b A = deque(sorted(a,reverse=True)) deque(sorted(a,reverse=True)) A a = list(map(int,input().split())) list(map(int,input().split())) a
from collections import deque
n,m = list(map(int,input().split()))
a = list(map(int,input().split()))

A = deque(sorted(a,reverse=True))
B = deque([])

for _ in range(m):
    #if _ % (m//10) == 0: print(A, B)
    if A:
        if B:
            if (A[0] > B[0]):
                B.append(A.popleft()//2)
                continue
        else:
            B.append(A.popleft()//2)
            continue
    b = B.popleft()
    B.append(b//2)

print(sum(A)+sum(B))
