Buggy python submission (verdict: Time Limit Exceeded):
N,M=map(int,input().split())
A=list(map(int,input().split()))
A.sort(reverse=True)
j=0
for i in range(M):
    A[A.index(max(A[:j+1]))]=A[A.index(max(A[:j+1]))]//2
    j=j+1
    if j==250:
        A.sort(reverse=True)    
        j=0
print(sum(A))

Fixed submission:
import heapq
N,M=map(int,input().split())
A=list(map(lambda x: x*(-1),list(map(int,input().split()))))
A.sort()
B=[]
for i in range(N):
    heapq.heappush(B,A[i])
for i in range(M):
    heapq.heappush(B,(((heapq.heappop(B))*(-1))//2)*(-1))
print((sum(B))*(-1))

Buggy python submission (verdict: Time Limit Exceeded):
N,M=map(int,input().split())
A=list(map(int,input().split()))
A.sort(reverse=True)
j=0
for i in range(M):
    A[A.index(max(A[:j+1]))]=A[A.index(max(A[:j+1]))]//2
    j=j+1
    if j==100:
        A.sort(reverse=True)    
        j=0
print(sum(A))

Fixed submission:
import heapq
N,M=map(int,input().split())
A=list(map(lambda x: x*(-1),list(map(int,input().split()))))
A.sort()
B=[]
for i in range(N):
    heapq.heappush(B,A[i])
for i in range(M):
    heapq.heappush(B,(((heapq.heappop(B))*(-1))//2)*(-1))
print((sum(B))*(-1))

Buggy python submission (verdict: Time Limit Exceeded):
N,M=map(int,input().split())
A=list(map(int,input().split()))
A.sort(reverse=True)
j=0
for i in range(M):
    A[A.index(max(A[:j+1]))]=A[A.index(max(A[:j+1]))]//2
    j=j+1
    if j==50:
        A.sort(reverse=True)    
        j=0
print(sum(A))

Fixed submission:
import heapq
N,M=map(int,input().split())
A=list(map(lambda x: x*(-1),list(map(int,input().split()))))
A.sort()
B=[]
for i in range(N):
    heapq.heappush(B,A[i])
for i in range(M):
    heapq.heappush(B,(((heapq.heappop(B))*(-1))//2)*(-1))
print((sum(B))*(-1))

Buggy python submission (verdict: Time Limit Exceeded):
N,M=map(int,input().split())
A=list(map(int,input().split()))
A.sort(reverse=True)
j=0
for i in range(M):
    A[A.index(max(A[:j+1]))]=A[A.index(max(A[:j+1]))]//2
    j=j+1
    if j==200:
        A.sort(reverse=True)    
        j=0
print(sum(A))

Fixed submission:
import heapq
N,M=map(int,input().split())
A=list(map(lambda x: x*(-1),list(map(int,input().split()))))
A.sort()
B=[]
for i in range(N):
    heapq.heappush(B,A[i])
for i in range(M):
    heapq.heappush(B,(((heapq.heappop(B))*(-1))//2)*(-1))
print((sum(B))*(-1))

Buggy python submission (verdict: Time Limit Exceeded):
N,M=map(int,input().split())
A=list(map(int,input().split()))
A.sort(reverse=True)
j=0
for i in range(M):
    A[A.index(max(A[:j+1]))]=A[A.index(max(A[:j+1]))]//2
    j=j+1
    if j==440:
        A.sort(reverse=True)    
        j=0
print(sum(A))

Fixed submission:
import heapq
N,M=map(int,input().split())
A=list(map(lambda x: x*(-1),list(map(int,input().split()))))
A.sort()
B=[]
for i in range(N):
    heapq.heappush(B,A[i])
for i in range(M):
    heapq.heappush(B,(((heapq.heappop(B))*(-1))//2)*(-1))
print((sum(B))*(-1))

Buggy python submission (verdict: Time Limit Exceeded):
N,M=map(int,input().split())
A=list(map(int,input().split()))
A.sort(reverse=True)
j=0
for i in range(M):
    A[A.index(max(A[:j+1]))]=A[A.index(max(A[:j+1]))]//2
    j=j+1
    if j==300:
        A.sort(reverse=True)    
        j=0
print(sum(A))

Fixed submission:
import heapq
N,M=map(int,input().split())
A=list(map(lambda x: x*(-1),list(map(int,input().split()))))
A.sort()
B=[]
for i in range(N):
    heapq.heappush(B,A[i])
for i in range(M):
    heapq.heappush(B,(((heapq.heappop(B))*(-1))//2)*(-1))
print((sum(B))*(-1))

Buggy python submission (verdict: Time Limit Exceeded):
N,M=map(int,input().split())
A=list(map(int,input().split()))
A.sort(reverse=True)
j=0
for i in range(M):
    A[A.index(max(A[:j+1]))]=A[A.index(max(A[:j+1]))]//2
    j=j+1
    if j==1000:
        A.sort(reverse=True)    
        j=0
print(sum(A))

Fixed submission:
import heapq
N,M=map(int,input().split())
A=list(map(lambda x: x*(-1),list(map(int,input().split()))))
A.sort()
B=[]
for i in range(N):
    heapq.heappush(B,A[i])
for i in range(M):
    heapq.heappush(B,(((heapq.heappop(B))*(-1))//2)*(-1))
print((sum(B))*(-1))

Buggy python submission (verdict: Time Limit Exceeded):
N,M=map(int,input().split())
A=list(map(int,input().split()))
A.sort(reverse=True)
for i in range(M):
    A[A.index(max(A[:i+1]))]=A[A.index(max(A[:i+1]))]//2
print(sum(A))

Fixed submission:
import heapq
N,M=map(int,input().split())
A=list(map(lambda x: x*(-1),list(map(int,input().split()))))
A.sort()
B=[]
for i in range(N):
    heapq.heappush(B,A[i])
for i in range(M):
    heapq.heappush(B,(((heapq.heappop(B))*(-1))//2)*(-1))
print((sum(B))*(-1))

Buggy python submission (verdict: Runtime Error):
N,M=map(int,input().split())
A=list(map(int,input().split()))
A.sort(reverse=True)
while M>0:
    if A[0]//2<A[1]:
        A_0=A[0]
        i=0
        while A[i]>=A_0 and i<M and i<N:
            A[i]=A[i]//2
            i+=1
        A.sort(reverse=True)
        M-=i
    else:
        A[0]=A[0]//2
        M-=1
print(sum(A))

Fixed submission:
import heapq
N,M=map(int,input().split())
A=list(map(lambda x: x*(-1),list(map(int,input().split()))))
A.sort()
B=[]
for i in range(N):
    heapq.heappush(B,A[i])
for i in range(M):
    heapq.heappush(B,(((heapq.heappop(B))*(-1))//2)*(-1))
print((sum(B))*(-1))

Buggy python submission (verdict: Time Limit Exceeded):
N,M=map(int,input().split())
A=list(map(int,input().split()))
for i in range(M):
    A.sort(reverse=True)
    A[0]=A[0]//2
print(sum(A))

Fixed submission:
import heapq
N,M=map(int,input().split())
A=list(map(lambda x: x*(-1),list(map(int,input().split()))))
A.sort()
B=[]
for i in range(N):
    heapq.heappush(B,A[i])
for i in range(M):
    heapq.heappush(B,(((heapq.heappop(B))*(-1))//2)*(-1))
print((sum(B))*(-1))