Buggy python submission (verdict: Time Limit Exceeded):
import sys
n,m = map(int,input().split())
lst_a = list(map(int,input().split()))
lst_a.sort(reverse=True)
temp = 0
ans = 0
if n == 1:
    for i in range(m):
        lst_a[0] //= 2
    print(lst_a[0])
    sys.exit()
for i in range(m):
    if lst_a[0] >= lst_a[1]:
        lst_a[0] //= 2
    else:
        lst_a[1] //= 2
        lst_a.sort(reverse=True)
print(sum(lst_a))


Fixed submission:
import sys
n,m = map(int,input().split())
lst_a = list(map(int,input().split()))
temp = 0
cnt = 0
fin = 0
loop = 0
debug = 0
temp2 = 0
if n == 1:
    for i in range(m):
        lst_a[0] //= 2
    print(lst_a[0])
    sys.exit()
while debug < 10:
    loop = 0
    #temp2 = temp
    temp = 0
    lst_a.sort(reverse=True)
    while loop < n-1:
        lst_a[loop] //= 2
        cnt += 1
        temp = max(temp,lst_a[loop])
        if cnt == m:
            #print(lst_a)
            print(sum(lst_a))
            sys.exit()
        if temp > max(lst_a[loop],lst_a[loop + 1]):
            break
        if lst_a[loop + 1] > lst_a[loop]:
            loop += 1
        
        
        
"""        if lst_a[loop] >= max(lst_a[loop + 1],temp):
            lst_a[loop] //= 2
            temp = max(lst_a[loop],lst_a[loop+1])
            cnt += 1
            if cnt == m:
                print(sum(lst_a))
                sys.exit()
            if temp > lst_a[loop + 1]:
                break
            
            
        loop += 1
    
    #debug += 1
print(lst_a[99999])
# print(temp)
# print(cnt)
# print(lst_a)
# print(sum(lst_a))
"""

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

n,m = map(int,input().split())
list_a = list(map(int,input().split()))
#b_list = list(map(int,input().split()))
#print(" ".join(map(str,c_list)))
check = 0
list_a.sort(reverse = True)
for i in range(m):
    list_a[np.argmax(list_a[0:6])] = list_a[np.argmax(list_a[0:6])] //2
    check += 1
    if check == 5:
        list_a.sort(reverse = True)
        check = 0
print(sum(list_a))


Fixed submission:
import sys
n,m = map(int,input().split())
lst_a = list(map(int,input().split()))
temp = 0
cnt = 0
fin = 0
loop = 0
debug = 0
temp2 = 0
if n == 1:
    for i in range(m):
        lst_a[0] //= 2
    print(lst_a[0])
    sys.exit()
while debug < 10:
    loop = 0
    #temp2 = temp
    temp = 0
    lst_a.sort(reverse=True)
    while loop < n-1:
        lst_a[loop] //= 2
        cnt += 1
        temp = max(temp,lst_a[loop])
        if cnt == m:
            #print(lst_a)
            print(sum(lst_a))
            sys.exit()
        if temp > max(lst_a[loop],lst_a[loop + 1]):
            break
        if lst_a[loop + 1] > lst_a[loop]:
            loop += 1
        
        
        
"""        if lst_a[loop] >= max(lst_a[loop + 1],temp):
            lst_a[loop] //= 2
            temp = max(lst_a[loop],lst_a[loop+1])
            cnt += 1
            if cnt == m:
                print(sum(lst_a))
                sys.exit()
            if temp > lst_a[loop + 1]:
                break
            
            
        loop += 1
    
    #debug += 1
print(lst_a[99999])
# print(temp)
# print(cnt)
# print(lst_a)
# print(sum(lst_a))
"""

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
import sys
n,m = map(int,input().split())
list_a = list(map(int,input().split()))
#b_list = list(map(int,input().split()))
#print(" ".join(map(str,c_list)))
list_a.sort(reverse = True)
a_max = list_a[0] // 2
list_a[0] = a_max
count = 1
if m == 1:
    print(sum(list_a))
    sys.exit()
if n == 1:
    for i in range(m-1):
        list_a[0]  = list_a[0] // 2
    print(sum(list_a))
    sys.exit()
for i in range(m-1):
    if list_a[np.argmax(list_a[0:count])] < list_a[count]:
        #print(list_a[np.argmax(list_a[0:count])],list_a[count])
        list_a[count] = list_a[count] // 2 
        if count < len(list_a) - 1:
            count += 1
    else:
        list_a[np.argmax(list_a[0:count])] = list_a[np.argmax(list_a[0:count])] // 2
        #print(list_a[np.argmax(list_a[0:count])])
print(sum(list_a))
"""
for i in range(m):
    count = 0
    while count == 0:

        for j in range(n):
            
            if list_a[j] > a_max:
                list_a[j] = list_a[j]//2
                a_max = a_max//2
                count = 1 
                print("c=1")
                print(a_max)
                print(list_a)
                break
        if count == 0:
            a_max -= 1
            print("c=0")
    
print(list_a)
"""

Fixed submission:
import sys
n,m = map(int,input().split())
lst_a = list(map(int,input().split()))
temp = 0
cnt = 0
fin = 0
loop = 0
debug = 0
temp2 = 0
if n == 1:
    for i in range(m):
        lst_a[0] //= 2
    print(lst_a[0])
    sys.exit()
while debug < 10:
    loop = 0
    #temp2 = temp
    temp = 0
    lst_a.sort(reverse=True)
    while loop < n-1:
        lst_a[loop] //= 2
        cnt += 1
        temp = max(temp,lst_a[loop])
        if cnt == m:
            #print(lst_a)
            print(sum(lst_a))
            sys.exit()
        if temp > max(lst_a[loop],lst_a[loop + 1]):
            break
        if lst_a[loop + 1] > lst_a[loop]:
            loop += 1
        
        
        
"""        if lst_a[loop] >= max(lst_a[loop + 1],temp):
            lst_a[loop] //= 2
            temp = max(lst_a[loop],lst_a[loop+1])
            cnt += 1
            if cnt == m:
                print(sum(lst_a))
                sys.exit()
            if temp > lst_a[loop + 1]:
                break
            
            
        loop += 1
    
    #debug += 1
print(lst_a[99999])
# print(temp)
# print(cnt)
# print(lst_a)
# print(sum(lst_a))
"""

Buggy python submission (verdict: Runtime Error):
import numpy as np
import sys
n,m = map(int,input().split())
list_a = list(map(int,input().split()))
#b_list = list(map(int,input().split()))
#print(" ".join(map(str,c_list)))
list_a.sort(reverse = True)
a_max = list_a[0] // 2
list_a[0] = a_max
count = 1
if m == 1:
    print(sum(list_a))
    sys.exit()
for i in range(m-1):
    if list_a[np.argmax(list_a[0:count])] < list_a[count]:
        #print(list_a[np.argmax(list_a[0:count])],list_a[count])
        list_a[count] = list_a[count] // 2 
        count += 1
    else:
        list_a[np.argmax(list_a[0:count])] = list_a[np.argmax(list_a[0:count])] // 2
        #print(list_a[np.argmax(list_a[0:count])])
print(sum(list_a))
"""
for i in range(m):
    count = 0
    while count == 0:

        for j in range(n):
            
            if list_a[j] > a_max:
                list_a[j] = list_a[j]//2
                a_max = a_max//2
                count = 1 
                print("c=1")
                print(a_max)
                print(list_a)
                break
        if count == 0:
            a_max -= 1
            print("c=0")
    
print(list_a)
"""

Fixed submission:
import sys
n,m = map(int,input().split())
lst_a = list(map(int,input().split()))
temp = 0
cnt = 0
fin = 0
loop = 0
debug = 0
temp2 = 0
if n == 1:
    for i in range(m):
        lst_a[0] //= 2
    print(lst_a[0])
    sys.exit()
while debug < 10:
    loop = 0
    #temp2 = temp
    temp = 0
    lst_a.sort(reverse=True)
    while loop < n-1:
        lst_a[loop] //= 2
        cnt += 1
        temp = max(temp,lst_a[loop])
        if cnt == m:
            #print(lst_a)
            print(sum(lst_a))
            sys.exit()
        if temp > max(lst_a[loop],lst_a[loop + 1]):
            break
        if lst_a[loop + 1] > lst_a[loop]:
            loop += 1
        
        
        
"""        if lst_a[loop] >= max(lst_a[loop + 1],temp):
            lst_a[loop] //= 2
            temp = max(lst_a[loop],lst_a[loop+1])
            cnt += 1
            if cnt == m:
                print(sum(lst_a))
                sys.exit()
            if temp > lst_a[loop + 1]:
                break
            
            
        loop += 1
    
    #debug += 1
print(lst_a[99999])
# print(temp)
# print(cnt)
# print(lst_a)
# print(sum(lst_a))
"""

Buggy python submission (verdict: Runtime Error):
import numpy as np

n,m = map(int,input().split())
list_a = list(map(int,input().split()))
#b_list = list(map(int,input().split()))
#print(" ".join(map(str,c_list)))
list_a.sort(reverse = True)
a_max = list_a[0] // 2
list_a[0] = a_max
count = 2
for i in range(m-1):
    if list_a[np.argmax(list_a[0:count])] < list_a[count]:
        #print(list_a[np.argmax(list_a[0:count])],list_a[count])
        list_a[count] = list_a[count] // 2 
        count += 1
    else:
        list_a[np.argmax(list_a[0:count])] = list_a[np.argmax(list_a[0:count])] // 2
        #print(list_a[np.argmax(list_a[0:count])])
    
print(sum(list_a))
"""
for i in range(m):
    count = 0
    while count == 0:

        for j in range(n):
            
            if list_a[j] > a_max:
                list_a[j] = list_a[j]//2
                a_max = a_max//2
                count = 1 
                print("c=1")
                print(a_max)
                print(list_a)
                break
        if count == 0:
            a_max -= 1
            print("c=0")
    
print(list_a)
"""

Fixed submission:
import sys
n,m = map(int,input().split())
lst_a = list(map(int,input().split()))
temp = 0
cnt = 0
fin = 0
loop = 0
debug = 0
temp2 = 0
if n == 1:
    for i in range(m):
        lst_a[0] //= 2
    print(lst_a[0])
    sys.exit()
while debug < 10:
    loop = 0
    #temp2 = temp
    temp = 0
    lst_a.sort(reverse=True)
    while loop < n-1:
        lst_a[loop] //= 2
        cnt += 1
        temp = max(temp,lst_a[loop])
        if cnt == m:
            #print(lst_a)
            print(sum(lst_a))
            sys.exit()
        if temp > max(lst_a[loop],lst_a[loop + 1]):
            break
        if lst_a[loop + 1] > lst_a[loop]:
            loop += 1
        
        
        
"""        if lst_a[loop] >= max(lst_a[loop + 1],temp):
            lst_a[loop] //= 2
            temp = max(lst_a[loop],lst_a[loop+1])
            cnt += 1
            if cnt == m:
                print(sum(lst_a))
                sys.exit()
            if temp > lst_a[loop + 1]:
                break
            
            
        loop += 1
    
    #debug += 1
print(lst_a[99999])
# print(temp)
# print(cnt)
# print(lst_a)
# print(sum(lst_a))
"""

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

n,m = map(int,input().split())
list_a = list(map(int,input().split()))
#b_list = list(map(int,input().split()))
#print(" ".join(map(str,c_list)))

for i in range(m):
    a = np.argmax(list_a)
    list_a[a] = list_a[a] // 2
    """
    if list_a[0] % 2 != 0:
        list_a[0] = list_a[0] // 2 - 1
    else:
        list_a[0] = list_a[0] // 2
    """
print(sum(list_a))

Fixed submission:
import sys
n,m = map(int,input().split())
lst_a = list(map(int,input().split()))
temp = 0
cnt = 0
fin = 0
loop = 0
debug = 0
temp2 = 0
if n == 1:
    for i in range(m):
        lst_a[0] //= 2
    print(lst_a[0])
    sys.exit()
while debug < 10:
    loop = 0
    #temp2 = temp
    temp = 0
    lst_a.sort(reverse=True)
    while loop < n-1:
        lst_a[loop] //= 2
        cnt += 1
        temp = max(temp,lst_a[loop])
        if cnt == m:
            #print(lst_a)
            print(sum(lst_a))
            sys.exit()
        if temp > max(lst_a[loop],lst_a[loop + 1]):
            break
        if lst_a[loop + 1] > lst_a[loop]:
            loop += 1
        
        
        
"""        if lst_a[loop] >= max(lst_a[loop + 1],temp):
            lst_a[loop] //= 2
            temp = max(lst_a[loop],lst_a[loop+1])
            cnt += 1
            if cnt == m:
                print(sum(lst_a))
                sys.exit()
            if temp > lst_a[loop + 1]:
                break
            
            
        loop += 1
    
    #debug += 1
print(lst_a[99999])
# print(temp)
# print(cnt)
# print(lst_a)
# print(sum(lst_a))
"""

Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int,input().split())
list_a = list(map(int,input().split()))
#b_list = list(map(int,input().split()))
#print(" ".join(map(str,c_list)))

for i in range(m):
    list_a.sort(reverse = True)
    list_a[0] = list_a[0] //2
    """
    if list_a[0] % 2 != 0:
        list_a[0] = list_a[0] // 2 - 1
    else:
        list_a[0] = list_a[0] // 2
    """
print(sum(list_a))

Fixed submission:
import sys
n,m = map(int,input().split())
lst_a = list(map(int,input().split()))
temp = 0
cnt = 0
fin = 0
loop = 0
debug = 0
temp2 = 0
if n == 1:
    for i in range(m):
        lst_a[0] //= 2
    print(lst_a[0])
    sys.exit()
while debug < 10:
    loop = 0
    #temp2 = temp
    temp = 0
    lst_a.sort(reverse=True)
    while loop < n-1:
        lst_a[loop] //= 2
        cnt += 1
        temp = max(temp,lst_a[loop])
        if cnt == m:
            #print(lst_a)
            print(sum(lst_a))
            sys.exit()
        if temp > max(lst_a[loop],lst_a[loop + 1]):
            break
        if lst_a[loop + 1] > lst_a[loop]:
            loop += 1
        
        
        
"""        if lst_a[loop] >= max(lst_a[loop + 1],temp):
            lst_a[loop] //= 2
            temp = max(lst_a[loop],lst_a[loop+1])
            cnt += 1
            if cnt == m:
                print(sum(lst_a))
                sys.exit()
            if temp > lst_a[loop + 1]:
                break
            
            
        loop += 1
    
    #debug += 1
print(lst_a[99999])
# print(temp)
# print(cnt)
# print(lst_a)
# print(sum(lst_a))
"""