import sys

import heapq

n, m = list(map(int, sys.stdin.readline().split()))

A = list([-int(x) for x in sys.stdin.readline().split()])

heapq.heapify(A)



for j in range(m):

    heapq.heappush(A ,int(A[0]/2))

    heapq.heappop(A)



print((-sum(A)))
#ABC141D

#heapq 効率的にリストの最小値を取り出す

def main():

    import sys, heapq as h

    N, M = list(map(int, sys.stdin.readline().split()))

    A = list([-int(x) for x in sys.stdin.readline().split()])

    #print(A)

    h.heapify(A) #heap化

    #print(A)

    for m in range(M):

        a = h.heappop(A)

        #print(int(a/2))

        h.heappush(A, int(a/2))

        #print(A)

    print((-sum(A)))



if __name__ =='__main__':

    main()

import sys
import heapq

n, m = list(map(int, sys.stdin.readline().split()))
A = list([-int(x) for x in sys.stdin.readline().split()])
heapq.heapify(A)
for j in range(m):
    heapq.heappush(A, int(A[0] / 2))
    heapq.heappop(A)
print((-sum(A)))

# ABC141D
# heapq 効率的にリストの最小値を取り出す
def main():
    import sys, heapq as h

    N, M = list(map(int, sys.stdin.readline().split()))
    A = list([-int(x) for x in sys.stdin.readline().split()])
    # print(A)
    h.heapify(A)  # heap化
    # print(A)
    for m in range(M):
        a = h.heappop(A)
        # print(int(a/2))
        h.heappush(A, int(a / 2))
        # print(A)
    print((-sum(A)))


if __name__ == "__main__":
    main()

-import sys -import heapq +# ABC141D +# heapq 効率的にリストの最小値を取り出す +def main(): +    import sys, heapq as h -n, m = list(map(int, sys.stdin.readline().split())) -A = list([-int(x) for x in sys.stdin.readline().split()]) -heapq.heapify(A) -for j in range(m): -    heapq.heappush(A, int(A[0] / 2)) -    heapq.heappop(A) -print((-sum(A))) +    N, M = list(map(int, sys.stdin.readline().split())) +    A = list([-int(x) for x in sys.stdin.readline().split()]) +    # print(A) +    h.heapify(A)  # heap化 +    # print(A) +    for m in range(M): +        a = h.heappop(A) +        # print(int(a/2)) +        h.heappush(A, int(a / 2)) +        # print(A) +    print((-sum(A))) + + +if __name__ == "__main__": +    main()