import sys
import math
import itertools
import collections
import heapq
import numpy as np

rl = sys.stdin.readline

n, m = map(int, rl().split())
h = list(map(lambda x: -1*int(x), rl().split()))
heapq.heapify(h)
for _ in range(m):
    heapq.heappushpop(h, math.ceil(h[0]/2))
print(-sum(h)) import sys sys import math math import itertools itertools import collections collections import heapq heapq import numpy as np numpy rl = sys.stdin.readline rl sys.stdin.readline sys.stdin sys stdin readline n, m = map(int, rl().split()) n map(int, rl().split()) map int rl().split() ().split () rl split m h = list(map(lambda x: -1*int(x), rl().split())) h list(map(lambda x: -1*int(x), rl().split())) list map(lambda x: -1*int(x), rl().split()) map lambda x: -1*int(x) -1*int(x) -1 int(x) int x x rl().split() ().split () rl split heapq.heapify(h) heapq.heapify heapq heapify h for _ in range(m):
    heapq.heappushpop(h, math.ceil(h[0]/2)) _ range(m) range m heapq.heappushpop(h, math.ceil(h[0]/2)) heapq.heappushpop heapq heappushpop h math.ceil(h[0]/2) math.ceil math ceil h[0]/2 h[0] h 0 2 print(-sum(h)) print -sum(h) sum(h) sum h h = list(map(lambda x: -1*int(x), rl().split())) list(map(lambda x: -1*int(x), rl().split())) h m = map(int, rl().split()) map(int, rl().split()) m rl = sys.stdin.readline sys.stdin.readline rl n, m = map(int, rl().split()) map(int, rl().split()) n
import sys
import math
import itertools
import collections
import heapq
import numpy as np

rl = sys.stdin.readline

n, m = map(int, rl().split())
h = list(map(lambda x: -1*int(x), rl().split()))
heapq.heapify(h)
for _ in range(m):
    heapq.heappushpop(h, math.ceil(h[0]/2))
print(-sum(h))