import sys
import heapq
input = sys.stdin.readline

N, M = map(int, input().split())
A = list(map(int, input().split()))
for i in range(N):
    A[i] = (-1)*A[i]

heapq.heapify(A)

for i in range(M):
    a = heapq.heappop(A)
    heapq.heappush(A, int(a/2))

print(abs(sum(A))) import sys sys import heapq heapq input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline 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 for i in range(N):
    A[i] = (-1)*A[i] i range(N) range N A[i] = (-1)*A[i] A[i] A i (-1)*A[i] -1 A[i] A i heapq.heapify(A) heapq.heapify heapq heapify A for i in range(M):
    a = heapq.heappop(A)
    heapq.heappush(A, int(a/2)) i range(M) range M a = heapq.heappop(A) a heapq.heappop(A) heapq.heappop heapq heappop A heapq.heappush(A, int(a/2)) heapq.heappush heapq heappush A int(a/2) int a/2 a 2 print(abs(sum(A))) print abs(sum(A)) abs sum(A) sum A M = map(int, input().split()) map(int, input().split()) M input = sys.stdin.readline sys.stdin.readline input A = list(map(int, input().split())) list(map(int, input().split())) A N, M = map(int, input().split()) map(int, input().split()) N a = heapq.heappop(A) heapq.heappop(A) a
import sys
import heapq
input = sys.stdin.readline

N, M = map(int, input().split())
A = list(map(int, input().split()))
for i in range(N):
    A[i] = (-1)*A[i]

heapq.heapify(A)

for i in range(M):
    a = heapq.heappop(A)
    heapq.heappush(A, int(a/2))

print(abs(sum(A)))