from heapq import heappop, heapify, heappush
def main():
    n, m = list(map(int, input().split()))
    A = list(map(lambda x: -int(x), input().split()))
    heapify(A)
    for _ in range(m):
        a = heappop(A)
        if a == 0:
            break
        a = -int(-a // 2)
        heappush(A, a)
    print(sum([-a for a in A]))

if __name__ == '__main__':
    main() from heapq import heappop, heapify, heappush def main():
    n, m = list(map(int, input().split()))
    A = list(map(lambda x: -int(x), input().split()))
    heapify(A)
    for _ in range(m):
        a = heappop(A)
        if a == 0:
            break
        a = -int(-a // 2)
        heappush(A, a)
    print(sum([-a for a in A])) main n, m = list(map(int, input().split())) n list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split m A = list(map(lambda x: -int(x), input().split())) A list(map(lambda x: -int(x), input().split())) list map(lambda x: -int(x), input().split()) map lambda x: -int(x) -int(x) int(x) int x x input().split() ().split () input split heapify(A) heapify A for _ in range(m):
        a = heappop(A)
        if a == 0:
            break
        a = -int(-a // 2)
        heappush(A, a)
     _ range(m) range m a = heappop(A) a heappop(A) heappop A if a == 0:
            break
         a == 0 a 0 break a = -int(-a // 2) a -int(-a // 2) int(-a // 2) int -a // 2 -a a 2 heappush(A, a) heappush A a -a for a in A for a in A a A for a in A -a a print(sum([-a for a in A])) print sum([-a for a in A]) sum [-a for a in A] if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    n, m = list(map(int, input().split()))
    A = list(map(lambda x: -int(x), input().split()))
    heapify(A)
    for _ in range(m):
        a = heappop(A)
        if a == 0:
            break
        a = -int(-a // 2)
        heappush(A, a)
    print(sum([-a for a in A])) def main():
    n, m = list(map(int, input().split()))
    A = list(map(lambda x: -int(x), input().split()))
    heapify(A)
    for _ in range(m):
        a = heappop(A)
        if a == 0:
            break
        a = -int(-a // 2)
        heappush(A, a)
    print(sum([-a for a in A])) main
from heapq import heappop, heapify, heappush
def main():
    n, m = list(map(int, input().split()))
    A = list(map(lambda x: -int(x), input().split()))
    heapify(A)
    for _ in range(m):
        a = heappop(A)
        if a == 0:
            break
        a = -int(-a // 2)
        heappush(A, a)
    print(sum([-a for a in A]))

if __name__ == '__main__':
    main()
