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 i in range(m):

        item = heapq.heappop(a)

        heapq.heappush(a, (-1) * (-item // 2))

    print((-sum(a)))





if __name__ == '__main__':

    main()

import heapq



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

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



heapq.heapify(A)

for i in range(m):

    item = heapq.heappop(A)

    heapq.heappush(A, (-1) * (-item // 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 i in range(m):
        item = heapq.heappop(a)
        heapq.heappush(a, (-1) * (-item // 2))
    print((-sum(a)))


if __name__ == "__main__":
    main()

import heapq

n, m = list(map(int, input().split()))
A = list([-int(x) for x in input().split()])
heapq.heapify(A)
for i in range(m):
    item = heapq.heappop(A)
    heapq.heappush(A, (-1) * (-item // 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 i in range(m): -        item = heapq.heappop(a) -        heapq.heappush(a, (-1) * (-item // 2)) -    print((-sum(a))) - - -if __name__ == "__main__": -    main() +n, m = list(map(int, input().split())) +A = list([-int(x) for x in input().split()]) +heapq.heapify(A) +for i in range(m): +    item = heapq.heappop(A) +    heapq.heappush(A, (-1) * (-item // 2)) +print((-sum(A)))