import heapq

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


if __name__ == '__main__':
    main() import heapq heapq def main():
    N, M = map(int, input().split())
    A = [-v for v in list(map(int, input().split()))]
    heapq.heapify(A)
    for _ in range(M):
        v = heapq.heappop(A)
        heapq.heappush(A, v / 2)
    print(sum([int(-v) for v in A])) main N, M = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split M -v for v in list(map(int, input().split())) for v in list(map(int, input().split())) v list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split for v in list(map(int, input().split())) -v v A = [-v for v in list(map(int, input().split()))] A [-v for v in list(map(int, input().split()))] heapq.heapify(A) heapq.heapify heapq heapify A for _ in range(M):
        v = heapq.heappop(A)
        heapq.heappush(A, v / 2)
     _ range(M) range M v = heapq.heappop(A) v heapq.heappop(A) heapq.heappop heapq heappop A heapq.heappush(A, v / 2) heapq.heappush heapq heappush A v / 2 v 2 int(-v) for v in A for v in A v A for v in A int(-v) int -v v print(sum([int(-v) for v in A])) print sum([int(-v) for v in A]) sum [int(-v) for v in A] if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    N, M = map(int, input().split())
    A = [-v for v in list(map(int, input().split()))]
    heapq.heapify(A)
    for _ in range(M):
        v = heapq.heappop(A)
        heapq.heappush(A, v / 2)
    print(sum([int(-v) for v in A])) def main():
    N, M = map(int, input().split())
    A = [-v for v in list(map(int, input().split()))]
    heapq.heapify(A)
    for _ in range(M):
        v = heapq.heappop(A)
        heapq.heappush(A, v / 2)
    print(sum([int(-v) for v in A])) main
import heapq

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


if __name__ == '__main__':
    main()
