#!/usr/bin/python3

import heapq

def main():
    line1 = input()
    line2 = input()

    n, m = list(map(int, line1.split()))
    l = list(map(int, line2.split()))
    ans = sum(l)
    for i in range(len(l)):
        l[i] *= -1
    heapq.heapify(l)
    for i in range(m):
        price = heapq.heappop(l) * (-1)
        new_price = price // 2
        heapq.heappush(l, new_price * (-1))
        ans -= (price - new_price)
    print(ans)
    return

if __name__ == "__main__":
    main() import heapq heapq def main():
    line1 = input()
    line2 = input()

    n, m = list(map(int, line1.split()))
    l = list(map(int, line2.split()))
    ans = sum(l)
    for i in range(len(l)):
        l[i] *= -1
    heapq.heapify(l)
    for i in range(m):
        price = heapq.heappop(l) * (-1)
        new_price = price // 2
        heapq.heappush(l, new_price * (-1))
        ans -= (price - new_price)
    print(ans)
    return main line1 = input() line1 input() input line2 = input() line2 input() input n, m = list(map(int, line1.split())) n list(map(int, line1.split())) list map(int, line1.split()) map int line1.split() line1.split line1 split m l = list(map(int, line2.split())) l list(map(int, line2.split())) list map(int, line2.split()) map int line2.split() line2.split line2 split ans = sum(l) ans sum(l) sum l for i in range(len(l)):
        l[i] *= -1
     i range(len(l)) range len(l) len l l[i] *= -1 l[i] l i -1 heapq.heapify(l) heapq.heapify heapq heapify l for i in range(m):
        price = heapq.heappop(l) * (-1)
        new_price = price // 2
        heapq.heappush(l, new_price * (-1))
        ans -= (price - new_price)
     i range(m) range m price = heapq.heappop(l) * (-1) price heapq.heappop(l) * (-1) heapq.heappop(l) heapq.heappop heapq heappop l -1 new_price = price // 2 new_price price // 2 price 2 heapq.heappush(l, new_price * (-1)) heapq.heappush heapq heappush l new_price * (-1) new_price -1 ans -= (price - new_price) ans price - new_price price new_price print(ans) print ans return if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def main():
    line1 = input()
    line2 = input()

    n, m = list(map(int, line1.split()))
    l = list(map(int, line2.split()))
    ans = sum(l)
    for i in range(len(l)):
        l[i] *= -1
    heapq.heapify(l)
    for i in range(m):
        price = heapq.heappop(l) * (-1)
        new_price = price // 2
        heapq.heappush(l, new_price * (-1))
        ans -= (price - new_price)
    print(ans)
    return def main():
    line1 = input()
    line2 = input()

    n, m = list(map(int, line1.split()))
    l = list(map(int, line2.split()))
    ans = sum(l)
    for i in range(len(l)):
        l[i] *= -1
    heapq.heapify(l)
    for i in range(m):
        price = heapq.heappop(l) * (-1)
        new_price = price // 2
        heapq.heappush(l, new_price * (-1))
        ans -= (price - new_price)
    print(ans)
    return main
#!/usr/bin/python3

import heapq

def main():
    line1 = input()
    line2 = input()

    n, m = list(map(int, line1.split()))
    l = list(map(int, line2.split()))
    ans = sum(l)
    for i in range(len(l)):
        l[i] *= -1
    heapq.heapify(l)
    for i in range(m):
        price = heapq.heappop(l) * (-1)
        new_price = price // 2
        heapq.heappush(l, new_price * (-1))
        ans -= (price - new_price)
    print(ans)
    return

if __name__ == "__main__":
    main()