N, M = map(int, input().split())
A = list(map(int, input().split()))
from heapq import heapify, heappop, heappush
dis = []
for k in range(N):
  dis.append((-(A[k]-A[k]//2), k, 0))
heapify(dis)
while M:
  M -= 1
  item = heappop(dis)
  index = item[1]
  cnt = item[2] + 1
  discount = A[index]//pow(2, cnt) - A[index]//pow(2, cnt+1)
  heappush(dis, (-discount, index, cnt))

ans = 0
while dis:
  item = dis.pop()
  ans += A[item[1]]//pow(2, item[2])

print(ans) 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 from heapq import heapify, heappop, heappush dis = [] dis [] for k in range(N):
  dis.append((-(A[k]-A[k]//2), k, 0)) k range(N) range N dis.append((-(A[k]-A[k]//2), k, 0)) dis.append dis append (-(A[k]-A[k]//2), k, 0) -(A[k]-A[k]//2) A[k]-A[k]//2 A[k] A k A[k]//2 A[k] A k 2 k 0 heapify(dis) heapify dis while M:
  M -= 1
  item = heappop(dis)
  index = item[1]
  cnt = item[2] + 1
  discount = A[index]//pow(2, cnt) - A[index]//pow(2, cnt+1)
  heappush(dis, (-discount, index, cnt)) M M -= 1 M 1 item = heappop(dis) item heappop(dis) heappop dis index = item[1] index item[1] item 1 cnt = item[2] + 1 cnt item[2] + 1 item[2] item 2 1 discount = A[index]//pow(2, cnt) - A[index]//pow(2, cnt+1) discount A[index]//pow(2, cnt) - A[index]//pow(2, cnt+1) A[index]//pow(2, cnt) A[index] A index pow(2, cnt) pow 2 cnt A[index]//pow(2, cnt+1) A[index] A index pow(2, cnt+1) pow 2 cnt+1 cnt 1 heappush(dis, (-discount, index, cnt)) heappush dis (-discount, index, cnt) -discount discount index cnt ans = 0 ans 0 while dis:
  item = dis.pop()
  ans += A[item[1]]//pow(2, item[2]) dis item = dis.pop() item dis.pop() dis.pop dis pop ans += A[item[1]]//pow(2, item[2]) ans A[item[1]]//pow(2, item[2]) A[item[1]] A item[1] item 1 pow(2, item[2]) pow 2 item[2] item 2 print(ans) print ans A = list(map(int, input().split())) list(map(int, input().split())) A ans += A[item[1]]//pow(2, item[2]) A[item[1]]//pow(2, item[2]) ans item = heappop(dis) heappop(dis) item index = item[1] item[1] index dis = [] [] dis M -= 1 1 M M = map(int, input().split()) map(int, input().split()) M ans = 0 0 ans item = dis.pop() dis.pop() item cnt = item[2] + 1 item[2] + 1 cnt N, M = map(int, input().split()) map(int, input().split()) N discount = A[index]//pow(2, cnt) - A[index]//pow(2, cnt+1) A[index]//pow(2, cnt) - A[index]//pow(2, cnt+1) discount
N, M = map(int, input().split())
A = list(map(int, input().split()))
from heapq import heapify, heappop, heappush
dis = []
for k in range(N):
  dis.append((-(A[k]-A[k]//2), k, 0))
heapify(dis)
while M:
  M -= 1
  item = heappop(dis)
  index = item[1]
  cnt = item[2] + 1
  discount = A[index]//pow(2, cnt) - A[index]//pow(2, cnt+1)
  heappush(dis, (-discount, index, cnt))

ans = 0
while dis:
  item = dis.pop()
  ans += A[item[1]]//pow(2, item[2])

print(ans)
