CodeEff/ECCO huggingface dataset:
# Original solution
def calc_half(n):
    return int(n /  2)

n, m = list(map(int, input().split()))
a = list(map(int, input().split()))
a_half = list(map(calc_half, a))

for m_num in range(m):
    max_index = a.index(max(a))
    a[max_index] = a_half[max_index]
    a_half[max_index] = calc_half(a_half[max_index])

print((sum(a)))


# Optimized solution
import heapq
def calc_Inversion(num):
    return num * -1

n, m = list(map(int, input().split()))
a = list(map(calc_Inversion, list(map(int, input().split()))))

heapq.heapify(a)

for m_num in range(m):
    heapq.heappush(a, int(heapq.heappop(a) / 2))

print((sum(a) * -1))
# Original solution
import bisect
n, m = list(map(int, input().split()))
a = list(map(int, input().split()))
a.sort()
for i in range(m):
    tmp_max = a.pop()
    bisect.insort(a, tmp_max // 2)
print((sum(a)))

# Optimized solution
import heapq
n, m = list(map(int, input().split()))
a = list(map(int, input().split()))
a = list([x * (-1) for x in a])
heapq.heapify(a)
for _ in range(m):
    min = ((heapq.heappop(a) * (-1)) // 2) * (-1)
    heapq.heappush(a, min)
print((sum(a)*(-1)))
# Original solution
import bisect
N,M = list(map(int, input().split()))
A = list(map(int, input().split()))
A.sort()
for m in range(M):
    i = bisect.bisect_left(A, A[-1]/2)
    A.insert(i, A[-1]/2)
    A.pop()
print((sum(map(int, A))))

# Optimized solution
from heapq import heappush, heappop, heapify
N,M = list(map(int, input().split()))
A = list(map(int, input().split()))
heap = [-a for a in A]
heapify(heap)
for i in range(M):
    hmax = heappop(heap)
    heappush(heap, hmax/2)
print((sum([int(-x) for x in heap])))
# Original solution
from heapq import heappush, heappop, heapify
N,M = list(map(int, input().split()))
A = list(map(int, input().split()))
heap = [-a for a in A]
heapify(heap)
for i in range(M):
    hmax = heappop(heap)
    heappush(heap, hmax/2)
print((sum([int(-x) for x in heap])))

# Optimized solution
from heapq import heapify, heappush, heappop
N, M = list(map(int, input().split()))
A = list(map(int, input().split()))
A = list([-x for x in A])
heapify(A)
for i in range(M):
    mx = heappop(A)
    heappush(A, (-1)*(-mx//2))
A = list([-x for x in A])
print((sum(A)))
# Original solution
def d_powerful_discount_tickets():
    import heapq
    N, M = [int(i) for i in input().split()]
    A = [int(i) for i in input().split()]

    # 参考: https://juppy.hatenablog.com/entry/2019/04/05/蟻本_Python_プライオリティキュー_2_heapq_競技プログラミン
    def _heappush_max(heap, item):
        heap.append(item)
        heapq._siftdown_max(heap, 0, len(heap) - 1)

    def _heappop_max(heap):
        """Maxheap version of a heappop."""
        lastelt = heap.pop()    # raises appropriate IndexError if heap is empty
        if heap:
            returnitem = heap[0]
            heap[0] = lastelt
            heapq._siftup_max(heap, 0)
            return returnitem
        return lastelt

    heapq._heapify_max(A)
    for _ in range(M):
        _heappush_max(A, _heappop_max(A) // 2)
    return sum(A)

print((d_powerful_discount_tickets()))

# Optimized solution
def d_powerful_discount_tickets():
    from heapq import heapify, heappop, heappush
    N, M = [int(i) for i in input().split()]
    A = [-int(i) for i in input().split()]

    heapify(A)
    for _ in range(M):
        heappush(A, -(-heappop(A) // 2))
    return -sum(A)

print((d_powerful_discount_tickets()))
# Original solution
import bisect

[n, m] = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
a.sort()
for i in range(m):
    tmp = a.pop(-1)
    bisect.insort(a, int(tmp / 2))
print((sum(a)))

# Optimized solution
import heapq

[n, m] = [int(i) for i in input().split()]
a = [-1 * int(i) for i in input().split()]
heapq.heapify(a)
for i in range(m):
    tmp = heapq.heappop(a)
    heapq.heappush(a, int(tmp / 2))
print((-1 * sum(a)))
# Original solution
import math
import heapq

N, M = list(map(int, input().split()))
A = list([-int(a) for a in input().split()])
A.sort()
heapq.heapify(A)

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

amount = 0
for a in A:
  amount += math.floor(-a)
print(amount)

# Optimized solution
import math
import heapq

N, M = list(map(int, input().split()))
A = list([-int(a) for a in input().split()])
A.sort()
heapq.heapify(A)

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

amount = 0
for a in A:
  amount += math.floor(-a)
print(amount)
# Original solution
N,M = (int(i) for i in input().split())
A = [int(i) for i in input().split()]

for i in range(M):
  index = A.index(max(A))
  A[index] = A[index]//2

print((sum(A)))


# Optimized solution
import heapq

N,M = (int(i) for i in input().split())
A = [int(i) * (-1) for i in input().split()]
heapq.heapify(A)

for i in range(M):
  tmp = heapq.heappop(A)
  tmp = ((tmp * -1)//2) * -1
  heapq.heappush(A,tmp)

print(((-1)*sum(A)))
# Original solution
n,m=list(map(int,input().split()))
a=list(map(int,input().split()))
for i in range(m):
  x=a.index(max(a))
  a[x]//=2
print((sum(a)))

# Optimized solution
import heapq

n,m=list(map(int,input().split()))
a=list(map(int,input().split()))
a=list([x*(-1) for x in a])
heapq.heapify(a)
for _ in range(m):
  x=heapq.heappop(a)
  x=((x*(-1))//2)*(-1)
  heapq.heappush(a,x)










print((sum(a)*(-1)))
# Original solution
obj = input().strip().split(' ')
N, M = list(map(int, obj))

obj = input().strip().split(' ')
A_list = list(map(int, obj))

val_list = sorted(A_list, reverse=True)

can_insert = False
for _ in range(M):
    val = val_list.pop(0) // 2
    for i, v in enumerate(val_list):
        if val >= v:
            val_list.insert(i, val)
            can_insert = True
            break
    if not can_insert:
        val_list.append(val)

print((sum(val_list)))


# Optimized solution
from heapq import heappush, heappop, heapify

obj = input().strip().split(' ')
N, M = list(map(int, obj))

obj = input().strip().split(' ')
val_list = [-1 * item for item in list(map(int, obj))]

heapify(val_list)

for _ in range(M):
    val = (-1) * ((heappop(val_list) * (-1)) // 2)
    heappush(val_list, val)

print((-1 * sum(val_list)))
# Original solution
# -*- coding: utf-8 -*-

def ans() :
    n, m  = list(map(int, input().split()))
    a = list(map(int, input().split()))

    for i in range(m):
        j = a.index(max(a))
        a[j] = a[j] >> 1

    print((sum(a)))

if __name__ == '__main__':
    ans()

# Optimized solution
# -*- coding: utf-8 -*-

import heapq

def ans() :
    n, m  = list(map(int, input().split()))
    aa = list(map(int, input().split()))
    a = []
    for i in aa:
        heapq.heappush(a, int(i) * (-1))

    for i in range(m):
        head = heapq.heappop(a)
        head = (-1) * (-head // 2)
        heapq.heappush(a, head)

    print((-sum(a)))

if __name__ == '__main__':
    ans()
# Original solution
from heapq import heappush, heappop
import math
import sys
input = sys.stdin.readline

n, m = list(map(int, input().split()))
A =list(map(int, input().split()))
Hq = []
for a in A:
  heappush(Hq, -a)
 
for _ in range(m):
  max = -heappop(Hq)
  heappush(Hq, -math.floor(max/2))
print((-sum(Hq)))  

# Optimized solution
from heapq import *

n, m = list(map(int, input().split()))
A = list([int(x)*(-1) for x in input().split()])
heapify(A)

for _ in range(m):
    max_a = heappop(A)*(-1)
    max_a //= 2
    heappush(A, -max_a)
print((-sum(A)))
# Original solution
import os

N,M = (int(x) for x in input().split())
list = list(map(int,input().split()))

ans = 0
for i in range(0,M):
    a = list.index(max(list))
    list[a] = list[a]//2
for j in list:
    ans += j
print(ans)


# Optimized solution
import os
import heapq

N,M = (int(x) for x in input().split())
list = [-int(i) for i in input().split()]

heapq.heapify(list)
ans = 0
for i in range(0,M):
    a = heapq.heappop(list)
    heapq.heappush(list,-((-a)//2))
for j in list:
    ans += j*(-1)
print(ans)
# Original solution
# ABC141 D - Powerful Discount Tickets
from heapq import heappop,heappush,heapify

n,m = list(map(int, input().split()))
a = list(map(float,input().split()))

a_minus = [-x for x in a]

heapify(a_minus)

for _ in range(m):
    heappush(a_minus,-((-heappop(a_minus))//2))
ans = -sum(a_minus)
print((int(ans)))


# Optimized solution
import heapq as hp
n,m=list(map(int,input().split()))
a=list(map(int,input().split()))
a=[-x for x in a]
hp.heapify(a)

for i in range(m):
    t=hp.heappop(a)
    hp.heappush(a,-(-t//2))

print((-sum(a)))
# Original solution
N,M=list(map(int,input().split()))
List = list(map(int,input().split()))
for i in range(M):
    MaxY = max(List) 
    Y = List.index(MaxY)
    List[Y] = MaxY //2
Sum = 0
for j in range(N):
    Sum += List[j]
print(Sum)

# Optimized solution
import heapq

n, m = list(map(int, input().split()))
a = list([int(x)*(-1) for x in input().split()])
heapq.heapify(a)  

for _ in range(m):
    tmp_min = heapq.heappop(a)
    heapq.heappush(a, (-1)*(-tmp_min//2))  
print((-sum(a)))
# Original solution
n,m = list(map(int,input().split()))
A = list(map(int,input().split()))
for i in range(m):
    k = A.index(max(A))
    A[k] //= 2
print((sum(A)))


# Optimized solution
import heapq
n,m = list(map(int,input().split()))
A = list([int(x)*(-1) for x in input().split()])
heapq.heapify(A)

for i in range(m):
    tmp_min = heapq.heappop(A)
    heapq.heappush(A, (-1)*(-tmp_min//2))
print((-sum(A)))
# Original solution
import heapq
n,m = list(map(int,input().split()))
A = list([int(x)*(-1) for x in input().split()])
heapq.heapify(A)

for i in range(m):
    tmp_min = heapq.heappop(A)
    heapq.heappush(A, (-1)*(-tmp_min//2))
print((-sum(A)))

# Optimized solution
import sys
import heapq


def input():
    return sys.stdin.readline().strip()


def main():
    N, M = list(map(int, input().split()))

    A = list(map(int, input().split()))
    heap = []
    for a in A:
        heapq.heappush(heap, -1 * a)
    for i in range(M):
        a = heapq.heappop(heap)
        a *= -1
        a //= 2
        a *= -1
        heapq.heappush(heap, a)
    print((sum(heap) * (-1)))


if __name__ == "__main__":
    main()
# Original solution
import heapq
import math

n, m = list(map(int, input().split()))
a = [-1 * int(i) for i in input().split()]
heapq.heapify(a)
for _ in range(m):
    b = heapq.heappop(a)
    heapq.heappush(a, math.ceil(b / 2))
print((-1 * sum(a)))

# Optimized solution
import heapq
import math

n, m = list(map(int, input().split()))
a = []
for i in input().split():
    a.append(-1 * int(i))
heapq.heapify(a)
for _ in range(m):
    b = heapq.heappop(a)
    heapq.heappush(a, math.ceil(b / 2))
print((-1 * sum(a)))
# Original solution
# -*- coding: utf-8 -*-
import math
def main():
    N,M = list(map(int,input().split()))
    A = list(map(int,input().split()))
    for _ in range(M):
        MAX = max(A)
        tmpi = A.index(MAX)
        A[tmpi] = math.floor(A[tmpi]-(MAX/2))
    print((sum(A)))
if __name__ == '__main__':
    main()

# Optimized solution
# -*- coding: utf-8 -*-
import heapq as hq
def main():
    N,M = list(map(int,input().split()))
    A=[-int(j) for j in input().split()]
    hq.heapify(A)
    for _ in range(M):
        tmp = hq.heappop(A)
        hq.heappush(A,(-((-tmp)//2)))
    print((-sum(A)))
if __name__ == '__main__':
    main()
# Original solution
# ABC-141-D
N, M = list(map(int, input().split()))
A = list(map(int, input().split()))

for _ in range(M):
    A[A.index(max(A))] //= 2
    
print((sum(A)))

# Optimized solution
# ABC-141-D
# https://qiita.com/ellio08/items/fe52a9eb9499b7060ed6
import heapq

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

for _ in range(M):
    tmp = heapq.heappop(A) * (-1)
    heapq.heappush(A, (tmp//2)*-1)

# これだとTLEになる。
# for _ in range(M):
#     A[A.index(max(A))] //= 2

print((sum(A)*-1))
# Original solution
N, M = list(map(int, input().split()))
A = list(map(int, input().split()))
Q = []
for i in range(N):
  Q.append(max(A))
  A.remove(max(A))
for j in range(M):
  Q[0] //= 2
  for k in range(1, N-1):
    if Q[0] <= Q[k] and Q[0] >= Q[k+1]:
      Q.insert(k+1, Q[0])
      Q.remove(Q[0])
    if Q[0] < Q[N-1]:
      Q.append(Q[0])
      Q.remove(Q[0])
S = 0
for k in range(N):
  S += Q[k]
print(S)

# Optimized solution
import heapq
pq = []

N, M = list(map(int, input().split()))
A = list(map(int, input().split()))
for i in A:
  heapq.heappush(pq, -i)
for i in range(M):
  x = pq[0]
  heapq.heappop(pq)
  heapq.heappush(pq, -((-x)//2))
print((-sum(pq)))
# Original solution
n, m = list(map(int, input().split()))
a = [int(s) for s in input().split()]
# m回だけ最も大きい数字を2で割る
for i in range(m):
    a[a.index(max(a))] //= 2
print((sum(a[i] for i in range(n))))


# Optimized solution
import heapq
n, m = list(map(int, input().split()))
a = list(map(int, input().split()))
for i in range(n):
    a[i] *= -1

heapq.heapify(a)
for _ in range(m):
    x = heapq.heappop(a)
    heapq.heappush(a, (-x//2)*(-1))

print((-sum(a)))
# Original solution
import heapq
n, m = list(map(int,input().split()))
a = list(map(int,input().split()))
for i in range(n):
    a[i] *= -1
heapq.heapify(a)
while(m):
    heapq.heapreplace(a, int(a[0] / 2))
    m -= 1
res = -sum(a)
print(res)

# Optimized solution
import heapq
n, m = list(map(int,input().split()))
a = list(map(int,input().split()))
for i in range(n):
    a[i] *= -1
heapq.heapify(a)
while(m):
    heapq.heapreplace(a, -(-a[0] // 2))
    m -= 1
res = -sum(a)
print(res)
# Original solution
# D - Powerful Discount Tickets
n,m= list(map(int, input().split()))

list = [int(s) for s in input().split()]

list.sort(reverse=True)

i = 0
while (m != 0):
    list[i] = (int)(list[i] / 2)
    m = m - 1
    if len(list) == 0:
        continue
    else:
        list.sort(reverse=True)

print((sum(list)))

# Optimized solution
# D - Powerful Discount Tickets
import heapq
n,m= list(map(int, input().split()))

a = [int(s) for s in input().split()]
a = list([x*(-1) for x in a])  # 各要素を-1倍

heapq.heapify(a)

while (m != 0):
    heapq.heappush(a, (int)(heapq.heappop(a) / 2))
    m = m - 1

print((-sum(a)))
# Original solution
N, M = list(map(int, input().split()))
lst = list(map(int, input().split()))

for _ in range(M):
    n = max(lst)
    idx = lst.index(n)
    lst[idx] = n // 2
print((sum(lst)))

# Optimized solution
import heapq

N, M = list(map(int, input().split()))
lst = [int(x) * -1 for x in input().split()]
heapq.heapify(lst)
for _ in range(M):
    n = heapq.heappop(lst)
    n = n * -1 // 2 * -1
    heapq.heappush(lst, n)
print((sum(lst) * -1))
# Original solution
n, m = list(map(int, input().split()))
a = list(map(int, input().split()))

for i in range(m):
    a = sorted(a)[::-1]
    a[0] //= 2

print((sum(a)))

# Optimized solution
import heapq

n, m = list(map(int, input().split()))
a = list(map(int, input().split()))

for i in range(n):
    a[i] *= -1

heapq.heapify(a)

for i in range(m):
    ref = heapq.heappop(a)*-1
    ref //= 2
    heapq.heappush(a, -ref)

print((sum(a)*-1))
# Original solution
import math

def find_index(l, x, default=-1):
    return l.index(x) if x in l else default


def main():
    n,m = list(map(int, input().split()))
    A = list(map(int, input().split()))
    for i in range(m):
        maximum = max(A)
        index = find_index(A,maximum)
        A[index] = int(math.floor(maximum/2))
    print((sum(A)))


if __name__ == '__main__':
    main()


# Optimized solution
import heapq

def main():
    n,m = list(map(int, input().split()))
    A = list([-int(x) for x in input().split()])

    heapq.heapify(A)
    for i in range(m):
        temp_min = heapq.heappop(A)
        heapq.heappush(A, (-1)*(-temp_min//2))
    print((-sum(A)))


if __name__ == '__main__':
    main()
# Original solution
import math
 
N,M = list(map(int, input().split()))
L = list(map(int, input().split()))
 
L = sorted(L,reverse=True)
 
 
for i in range(0,M):
	L[0] = int(math.floor(L[0] / 2))
	L = sorted(L,reverse=True)
	
print((sum(L)))

# Optimized solution
import heapq

N,M = list(map(int, input().split()))
L = [-int(i) for i in input().split()]
heapq.heapify(L)



for i in range(M):
    h = -(-heapq.heappop(L) // 2)
 
    heapq.heappush(L,h)

print((-sum(L)))
# Original solution
import heapq
 
N, M = [int(s) for s in input().split()]
A = [int(s) for s in input().split()]
 
hpq = list([-1 * x for x in A])
for i in range(M):
    heapq.heapify(hpq)
    x = heapq.heappop(hpq)
    heapq.heappush(hpq, x / 2)

print((sum([int(-1 * x) for x in hpq])))

# Optimized solution
import heapq
 
N, M = [int(s) for s in input().split()]
A = [int(s) for s in input().split()]
 
hpq = list([-1 * x for x in A])
heapq.heapify(hpq)
for i in range(M):
    x = heapq.heappop(hpq)
    heapq.heappush(hpq, x / 2)

print((sum([int(-1 * x) for x in hpq])))
# Original solution
n,m=list(map(int,input().split()))
L=list(map(int,input().split()))
import bisect
from collections import deque
L.sort()
Ld=deque(L)
for i in range(m):
    x=L.pop()//2
    y=bisect.bisect_left(L,x)
    L.insert(y,x)
print((sum(L)))

# Optimized solution
n,m=list(map(int,input().split()))
L=list(map(int,input().split()))
Lh=list([x*(-1) for x in L])
import heapq
#heapqは置き直さなくてOK
heapq.heapify(Lh)
for _ in range(m):
    x=heapq.heappop(Lh)
    heapq.heappush(Lh,(x+1)//2)#負の数の割り算のため+1
print((sum(Lh)*(-1)))
# Original solution
import heapq
import math
N,M=list(map(int,input().split()))
A=list(map(int,input().split()))
A.sort()
logof2=[0]*N
mi=0
buf=0
#print(A)
for i in range(N):
    A[i]=-A[i]  #heapqは実装上最初値しか取り出さないので、数列を-1倍し、最小値が最大に当たるようにする
heapq.heapify(A)#priority_que化
for i in range(M):
    buf=heapq.heappop(A)    #最大値を取り出すことに相当
    buf=(-buf)/2           #切り捨て(floor)の挙動は負数の時おかしくなるので一旦正値に変換して計算し
    buf=-buf                #負数に戻す
    heapq.heappush(A,buf)   #
    #print(A)
for i in range(N):
    mi=mi+math.floor(-1*A[i])  #残った要素ごとの足し算に相当する

print(mi)


# Optimized solution
import heapq
import math
N,M=list(map(int,input().split()))
A=list(map(int,input().split()))
A.sort()
logof2=[0]*N
mi=0
buf=0
#print(A)
for i in range(N):
    A[i]=-A[i]  #heapqは実装上最初値しか取り出さないので、数列を-1倍し、最小値が最大に当たるようにする
heapq.heapify(A)#priority_que化
for i in range(M):
    buf=heapq.heappop(A)    #最大値を取り出すことに相当
    buf=-(-buf)/2            #切り捨て(floor)の挙動は負数の時おかしくなるので一旦正値に変換して計算し
    #buf=-buf                #負数に戻す
    heapq.heappush(A,buf)   #
    #print(A)
for i in range(N):
    mi=mi+math.floor(-1*A[i])  #残った要素ごとの足し算に相当する

print(mi)
# Original solution
import heapq
import math
N,M=list(map(int,input().split()))
A=list(map(int,input().split()))
A.sort()
logof2=[0]*N
mi=0
buf=0
#print(A)
for i in range(N):
    A[i]=-A[i]  #heapqは実装上最初値しか取り出さないので、数列を-1倍し、最小値が最大に当たるようにする
heapq.heapify(A)#priority_que化
for i in range(M):
    buf=heapq.heappop(A)    #最大値を取り出すことに相当
    buf=-(-buf)/2            #切り捨て(floor)の挙動は負数の時おかしくなるので一旦正値に変換して計算し
    #buf=-buf                #負数に戻す
    heapq.heappush(A,buf)   #
    #print(A)
for i in range(N):
    mi=mi+math.floor(-1*A[i])  #残った要素ごとの足し算に相当する

print(mi)


# Optimized solution
import heapq
import math
N,M=list(map(int,input().split()))
A=list(map(int,input().split()))
A.sort()
logof2=[0]*N
mi=0
buf=0
#print(A)
for i in range(N):
    A[i]=-A[i]  #heapqは実装上最初値しか取り出さないので、数列を-1倍し、最小値が最大に当たるようにする
heapq.heapify(A)#priority_que化
for i in range(M):
    buf=heapq.heappop(A)    #最大値を取り出すことに相当
    buf=buf/2            #切り捨て(floor)の挙動は負数の時おかしくなるので一旦正値に変換して計算し
    heapq.heappush(A,buf)   #
    #print(A)
for i in range(N):
    mi=mi+math.floor(-1*A[i])  #残った要素ごとの足し算に相当する

print(mi)
# Original solution
n,m = list(map(int,input().split()))
arr= list(map(int,input().split()))
 
while m > 0: 
    arr[arr.index(max(arr))] = max(arr)//2
    m -= 1
    
print((sum(arr)))

# Optimized solution
import heapq
n,m = list(map(int,input().split()))
arr= list([int(x)*(-1) for x in input().split()])
heapq.heapify(arr)
for i in range(m):
    d = heapq.heappop(arr)
    heapq.heappush(arr,-( -d//2))
print((sum(arr)*-1))
# Original solution
from collections import deque

N,M=list(map(int,input().split()))
A=deque([int(_) for _ in input().split()])

for m in range(M):
    a=max(A)
    A.remove(a)
    A.append(a//2)
print((sum(A)))

# Optimized solution
import heapq

N,M=list(map(int,input().split()))
A=[-int(_) for _ in input().split()]
heapq.heapify(A)

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

print((-sum(A)))
# Original solution
import math

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

# 割引は出来るだけする
for i in range(M):
	item_list[item_list.index(max(item_list))] = math.floor(max(item_list) / 2)

print((sum(item_list)))

# Optimized solution
import heapq

N, M = list(map(int, input().split()))
item_list = list([int(x)*(-1) for x in input().split()])
heapq.heapify(item_list)

# 割引は出来るだけする
for i in range(M):
	temp_min = heapq.heappop(item_list)
	heapq.heappush(item_list, (-1)*(-temp_min//2))
print((-sum(item_list)))
# Original solution
import math
n,m = list(map(int,input().split()))
price = list(map(int,input().split()))
price.sort(reverse=True)
while m != 0:
    tmp = max(price)
    tmp = tmp//2
    price[price.index(max(price))] = tmp
    m -= 1
print((sum(price)))

# Optimized solution
import heapq
n,m = list(map(int,input().split()))
p = list(map(int,input().split()))
price = [x*(-1) for x in p]
heapq.heapify(price)
while m != 0:
    max_price = heapq.heappop(price)*(-1)
    heapq.heappush(price,(max_price//2)*(-1))
    m -= 1
print((sum(price)*(-1)))
# Original solution
while True:
    n = int(eval(input()))
    if n == 0:
        break

    ice = [int(eval(input())) for _ in range(n)]
    for i in range(10):
        print(("*"*ice.count(i) + "-"*(ice.count(i)==0)))

# Optimized solution
while True:
    n = int(eval(input()))
    if n == 0:
        break

    ice = [int(eval(input())) for _ in range(n)]
    for i in range(10):
        nums = ice.count(i)
        print(("*"*nums + "-"*(nums==0)))
# Original solution
while True:
  n=int(eval(input()))
  x=[0 for i in range(10)]
  if n==0:
    break
  for i in range(n):
    a=int(eval(input()))
    if a==0:
      x[0]+=1
    elif a==1:
      x[1]+=1
    elif a==2:
      x[2]+=1
    elif a==3:
      x[3]+=1
    elif a==4:
      x[4]+=1
    elif a==5:
      x[5]+=1 
    elif a==6:
      x[6]+=1
    elif a==7:
      x[7]+=1
    elif a==8:
      x[8]+=1
    else:
      x[9]+=1
  for i in range(10):
    if x[i]==0:
      print(('{}'.format('-'))) 
    else:
      print(('{}'.format(x[i]*'*')))


# Optimized solution
while 1:
  n = int(eval(input()))
  if n == 0:
    break
  x = [0 for i in range(10)] 
  for i in range(n):
    c = int(eval(input()))
    x[c] += 1

  for i in range(10):
    count = '*' * x[i] 
    if len(count) == 0:
      print("-")
    else:
      print(count)
# Original solution
def main():
    print((input()[::2]))


if __name__ == '__main__':
    main()



# Optimized solution
def main():
    print((input()[0::2]))


if __name__ == '__main__':
    main()
# Original solution
print("".join(map(str, [c for i,c in enumerate(input()) if i % 2 == 0])))


# Optimized solution
print("".join([c for i,c in enumerate(input()) if i % 2 == 0]))
# Original solution
print((input()[::2]))

# Optimized solution
def main():
    print((input()[::2]))


if __name__ == '__main__':
    main()
# Original solution
import sys
def LS2(): return list(sys.stdin.readline().rstrip())  #空白なし


S = LS2()
ans = ''
for i in range(0,len(S),2):
    ans += S[i]

print(ans)


# Optimized solution
import sys
def S(): return sys.stdin.readline().rstrip()


S = S()
print((S[::2]))
# Original solution
s = input()
ans = ''
for i in range(len(s)):
    if i & 1 == 0:
        ans += s[i]
print(ans)


# Optimized solution
print((input()[::2]))
# Original solution
s = input()
print("".join([c for i, c in enumerate(s) if (i + 1) % 2 == 1]))


# Optimized solution
print("".join([c for i, c in enumerate(input()) if (i + 1) % 2 == 1]))
# Original solution
s = input()
for i in range(len(s)):
    if i % 2 == 0:
        print(s[i], end='')
print()


# Optimized solution
print((input()[::2]))
# Original solution
s = input()[::2]
print(s)

# Optimized solution
print((input()[::2]))