import heapq
import math

N, M = map(int, input().split())
A = list(map(int, input().split()))

B = [-A[i] for i in range(N)]
heapq.heapify(B)
while M:
    p = heapq.heappop(B)
    p /= 2
    heapq.heappush(B, p)
    M -= 1

ans = 0
for i in range(N):
    ans += math.floor(-B[i])
print(ans) import heapq heapq import math math N, M = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split M A = list(map(int, input().split())) A list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split -A[i] for i in range(N) for i in range(N) i range(N) range N for i in range(N) -A[i] A[i] A i B = [-A[i] for i in range(N)] B [-A[i] for i in range(N)] heapq.heapify(B) heapq.heapify heapq heapify B while M:
    p = heapq.heappop(B)
    p /= 2
    heapq.heappush(B, p)
    M -= 1 M p = heapq.heappop(B) p heapq.heappop(B) heapq.heappop heapq heappop B p /= 2 p 2 heapq.heappush(B, p) heapq.heappush heapq heappush B p M -= 1 M 1 ans = 0 ans 0 for i in range(N):
    ans += math.floor(-B[i]) i range(N) range N ans += math.floor(-B[i]) ans math.floor(-B[i]) math.floor math floor -B[i] B[i] B i print(ans) print ans A = list(map(int, input().split())) list(map(int, input().split())) A ans = 0 0 ans M = map(int, input().split()) map(int, input().split()) M M -= 1 1 M ans += math.floor(-B[i]) math.floor(-B[i]) ans N, M = map(int, input().split()) map(int, input().split()) N p /= 2 2 p p = heapq.heappop(B) heapq.heappop(B) p B = [-A[i] for i in range(N)] [-A[i] for i in range(N)] B
import heapq
import math

N, M = map(int, input().split())
A = list(map(int, input().split()))

B = [-A[i] for i in range(N)]
heapq.heapify(B)
while M:
    p = heapq.heappop(B)
    p /= 2
    heapq.heappush(B, p)
    M -= 1

ans = 0
for i in range(N):
    ans += math.floor(-B[i])
print(ans)
