from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
from bisect import bisect_left,bisect_right 
import sys,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

n,m = inpl()
a = inpl()
a = [-x for x in a]
heapify(a)
for _ in range(m):
    now = heappop(a)
    now /= 2
    heappush(a,now)
    # print(now)
res = 0
for x in a:
    res += int(-x)
print(res) from collections import Counter,defaultdict,deque from heapq import heappop,heappush,heapify from bisect import bisect_left,bisect_right import sys,math,itertools,fractions,pprint sys math itertools fractions pprint sys.setrecursionlimit(10**8) sys.setrecursionlimit sys setrecursionlimit 10**8 10 8 mod = 10**9+7 mod 10**9+7 10**9 10 9 7 INF = float('inf') INF float('inf') float 'inf' def inp(): return int(sys.stdin.readline()) inp def inpl(): return list(map(int, sys.stdin.readline().split())) inpl n,m = inpl() n inpl() inpl m a = inpl() a inpl() inpl -x for x in a for x in a x a for x in a -x x a = [-x for x in a] a [-x for x in a] heapify(a) heapify a for _ in range(m):
    now = heappop(a)
    now /= 2
    heappush(a,now)
    # print(now) _ range(m) range m now = heappop(a) now heappop(a) heappop a now /= 2 now 2 heappush(a,now) heappush a now res = 0 res 0 for x in a:
    res += int(-x) x a res += int(-x) res int(-x) int -x x print(res) print res def inpl(): return list(map(int, sys.stdin.readline().split())) def inpl(): return list(map(int, sys.stdin.readline().split())) inpl now = heappop(a) heappop(a) now now /= 2 2 now res = 0 0 res m = inpl() inpl() m mod = 10**9+7 10**9+7 mod res += int(-x) int(-x) res a = [-x for x in a] [-x for x in a] a INF = float('inf') float('inf') INF n,m = inpl() inpl() n def inp(): return int(sys.stdin.readline()) def inp(): return int(sys.stdin.readline()) inp a = inpl() inpl() a
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
from bisect import bisect_left,bisect_right 
import sys,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

n,m = inpl()
a = inpl()
a = [-x for x in a]
heapify(a)
for _ in range(m):
    now = heappop(a)
    now /= 2
    heappush(a,now)
    # print(now)
res = 0
for x in a:
    res += int(-x)
print(res)
