Check if the mid satisfies the given condition
if ( check ( mid , aux , K ) ) : NEW_LINE INDENT low = mid NEW_LINE DEDENT else : NEW_LINE INDENT high = mid NEW_LINE DEDENT if ( check ( high , aux , K ) ) : NEW_LINE return high NEW_LINE return low NEW_LINE