from heapq import heapify,heappush,heappop

def main():
    N,M = map(int,input().split())
    A = [-x for x in map(int,input().split())]
    heapify(A)
    for i in range(M):
        tmp = -heappop(A)
        tmp2 = tmp//2
        heappush(A,-tmp2)
    ans = 0
    for i in range(N):
        ans += A[i]

    ans = abs(ans)
    return ans

print(main()) from heapq import heapify,heappush,heappop def main():
    N,M = map(int,input().split())
    A = [-x for x in map(int,input().split())]
    heapify(A)
    for i in range(M):
        tmp = -heappop(A)
        tmp2 = tmp//2
        heappush(A,-tmp2)
    ans = 0
    for i in range(N):
        ans += A[i]

    ans = abs(ans)
    return ans main N,M = map(int,input().split()) N map(int,input().split()) map int input().split() ().split () input split M -x for x in map(int,input().split()) for x in map(int,input().split()) x map(int,input().split()) map int input().split() ().split () input split for x in map(int,input().split()) -x x A = [-x for x in map(int,input().split())] A [-x for x in map(int,input().split())] heapify(A) heapify A for i in range(M):
        tmp = -heappop(A)
        tmp2 = tmp//2
        heappush(A,-tmp2)
     i range(M) range M tmp = -heappop(A) tmp -heappop(A) heappop(A) heappop A tmp2 = tmp//2 tmp2 tmp//2 tmp 2 heappush(A,-tmp2) heappush A -tmp2 tmp2 ans = 0 ans 0 for i in range(N):
        ans += A[i]

     i range(N) range N ans += A[i] ans A[i] A i ans = abs(ans) ans abs(ans) abs ans return ans ans print(main()) print main() main def main():
    N,M = map(int,input().split())
    A = [-x for x in map(int,input().split())]
    heapify(A)
    for i in range(M):
        tmp = -heappop(A)
        tmp2 = tmp//2
        heappush(A,-tmp2)
    ans = 0
    for i in range(N):
        ans += A[i]

    ans = abs(ans)
    return ans def main():
    N,M = map(int,input().split())
    A = [-x for x in map(int,input().split())]
    heapify(A)
    for i in range(M):
        tmp = -heappop(A)
        tmp2 = tmp//2
        heappush(A,-tmp2)
    ans = 0
    for i in range(N):
        ans += A[i]

    ans = abs(ans)
    return ans main
from heapq import heapify,heappush,heappop

def main():
    N,M = map(int,input().split())
    A = [-x for x in map(int,input().split())]
    heapify(A)
    for i in range(M):
        tmp = -heappop(A)
        tmp2 = tmp//2
        heappush(A,-tmp2)
    ans = 0
    for i in range(N):
        ans += A[i]

    ans = abs(ans)
    return ans

print(main())
