import sys
import heapq


def main():
    input = sys.stdin.buffer.readline
    n, m = map(int, input().split())
    a = list(map(lambda x: -int(x), input().split()))
    heapq.heapify(a)
    for _ in range(m):
        price = heapq.heappop(a)
        heapq.heappush(a, -((-price) // 2))
    print(-sum(a))


if __name__ == "__main__":
    main() import sys sys import heapq heapq def main():
    input = sys.stdin.buffer.readline
    n, m = map(int, input().split())
    a = list(map(lambda x: -int(x), input().split()))
    heapq.heapify(a)
    for _ in range(m):
        price = heapq.heappop(a)
        heapq.heappush(a, -((-price) // 2))
    print(-sum(a)) main input = sys.stdin.buffer.readline input sys.stdin.buffer.readline sys.stdin.buffer sys.stdin sys stdin buffer readline n, m = map(int, input().split()) n 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 heapq.heapify(a) heapq.heapify heapq heapify a for _ in range(m):
        price = heapq.heappop(a)
        heapq.heappush(a, -((-price) // 2))
     _ range(m) range m price = heapq.heappop(a) price heapq.heappop(a) heapq.heappop heapq heappop a heapq.heappush(a, -((-price) // 2)) heapq.heappush heapq heappush a -((-price) // 2) (-price) // 2 -price price 2 print(-sum(a)) print -sum(a) sum(a) sum a if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def main():
    input = sys.stdin.buffer.readline
    n, m = map(int, input().split())
    a = list(map(lambda x: -int(x), input().split()))
    heapq.heapify(a)
    for _ in range(m):
        price = heapq.heappop(a)
        heapq.heappush(a, -((-price) // 2))
    print(-sum(a)) def main():
    input = sys.stdin.buffer.readline
    n, m = map(int, input().split())
    a = list(map(lambda x: -int(x), input().split()))
    heapq.heapify(a)
    for _ in range(m):
        price = heapq.heappop(a)
        heapq.heappush(a, -((-price) // 2))
    print(-sum(a)) main
import sys
import heapq


def main():
    input = sys.stdin.buffer.readline
    n, m = map(int, input().split())
    a = list(map(lambda x: -int(x), input().split()))
    heapq.heapify(a)
    for _ in range(m):
        price = heapq.heappop(a)
        heapq.heappush(a, -((-price) // 2))
    print(-sum(a))


if __name__ == "__main__":
    main()
