N,M = map(int,input().split())
A = list(map(int,input().split()))
su = sum(A)
l = []

for i in range(N):
    for j in range(30):
        l += -(-A[i]//2),
        A[i] //= 2

l.sort(reverse=True)

print(su - sum(l[:M])) 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 su = sum(A) su sum(A) sum A l = [] l [] for i in range(N):
    for j in range(30):
        l += -(-A[i]//2),
        A[i] //= 2 i range(N) range N for j in range(30):
        l += -(-A[i]//2),
        A[i] //= 2 j range(30) range 30 l += -(-A[i]//2), l -(-A[i]//2) -A[i]//2 -A[i] A[i] A i 2 A[i] //= 2 A[i] A i 2 l.sort(reverse=True) l.sort l sort reverse=True reverse True print(su - sum(l[:M])) print su - sum(l[:M]) su sum(l[:M]) sum l[:M] l :M M su = sum(A) sum(A) su N,M = map(int,input().split()) map(int,input().split()) N A = list(map(int,input().split())) list(map(int,input().split())) A l = [] [] l l += -(-A[i]//2), -(-A[i]//2) l M = map(int,input().split()) map(int,input().split()) M
N,M = map(int,input().split())
A = list(map(int,input().split()))
su = sum(A)
l = []

for i in range(N):
    for j in range(30):
        l += -(-A[i]//2),
        A[i] //= 2

l.sort(reverse=True)

print(su - sum(l[:M]))