Even Bruteforce did it


#1
def solve(self, A, B):
    top=max(A)
    n=len(A)
    for i in range(top,-1,-1):
        count=0
        for j in range(n):
            if A[j]>i:
                count=count+(A[j]-i)
        if count>=B:
            return i