import heapq

n, m = list(map(int, input().split()))

a = [-int(x) for x in input().split()]

heapq.heapify(a)



for i in range(m):

    l = -heapq.heappop(a)

    heapq.heappush(a, -(l//2))

    

print((-sum(a)))
import heapq

def main():

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

    A = list(int(x)*-1 for x in input().split())

    heapq.heapify(A)



    for _ in range(M):

        a = (heapq.heappop(A)*-1)//2

        heapq.heappush(A,a*-1)



    print((sum(A)*-1))



if __name__ == '__main__':

    main()
import heapq

n, m = list(map(int, input().split()))
a = [-int(x) for x in input().split()]
heapq.heapify(a)
for i in range(m):
    l = -heapq.heappop(a)
    heapq.heappush(a, -(l // 2))
print((-sum(a)))

import heapq


def main():
    N, M = list(map(int, input().split()))
    A = list(int(x) * -1 for x in input().split())
    heapq.heapify(A)
    for _ in range(M):
        a = (heapq.heappop(A) * -1) // 2
        heapq.heappush(A, a * -1)
    print((sum(A) * -1))


if __name__ == "__main__":
    main()

-n, m = list(map(int, input().split())) -a = [-int(x) for x in input().split()] -heapq.heapify(a) -for i in range(m): -    l = -heapq.heappop(a) -    heapq.heappush(a, -(l // 2)) -print((-sum(a))) + +def main(): +    N, M = list(map(int, input().split())) +    A = list(int(x) * -1 for x in input().split()) +    heapq.heapify(A) +    for _ in range(M): +        a = (heapq.heappop(A) * -1) // 2 +        heapq.heappush(A, a * -1) +    print((sum(A) * -1)) + + +if __name__ == "__main__": +    main()