import bisect

N,M = list(map(int,input().split()))

A = list(map(int,input().split()))



A.sort()

while M != 0:

    x = bisect.bisect_left(A,A[-1]/2)

    if N-x <= M:

        M -= N-x

        for i in range(x,N):

            A[i] = A[i]/2

        A.sort()

    else:

        for i in range(N-M,N):

            A[i] = A[i]/2

        M = 0

        A.sort()



print((sum(map(int,A))))

#二分探索を使った解法

import bisect

N,M = list(map(int,input().split()))

A = list(map(int,input().split()))



A.sort()

while M != 0:

    x = bisect.bisect_left(A,A[-1]//2)

    if N-x <= M:

        M -= N-x

        for i in range(x,N):

            A[i] = A[i]//2

        A.sort()

    else:

        for i in range(N-M,N):

            A[i] = A[i]//2

        M = 0

        A.sort()



print((sum(A)))
import bisect

N, M = list(map(int, input().split()))
A = list(map(int, input().split()))
A.sort()
while M != 0:
    x = bisect.bisect_left(A, A[-1] / 2)
    if N - x <= M:
        M -= N - x
        for i in range(x, N):
            A[i] = A[i] / 2
        A.sort()
    else:
        for i in range(N - M, N):
            A[i] = A[i] / 2
        M = 0
        A.sort()
print((sum(map(int, A))))

# 二分探索を使った解法
import bisect

N, M = list(map(int, input().split()))
A = list(map(int, input().split()))
A.sort()
while M != 0:
    x = bisect.bisect_left(A, A[-1] // 2)
    if N - x <= M:
        M -= N - x
        for i in range(x, N):
            A[i] = A[i] // 2
        A.sort()
    else:
        for i in range(N - M, N):
            A[i] = A[i] // 2
        M = 0
        A.sort()
print((sum(A)))

+# 二分探索を使った解法 -    x = bisect.bisect_left(A, A[-1] / 2) +    x = bisect.bisect_left(A, A[-1] // 2) -            A[i] = A[i] / 2 +            A[i] = A[i] // 2 -            A[i] = A[i] / 2 +            A[i] = A[i] // 2 -print((sum(map(int, A)))) +print((sum(A)))