Count the number of currency notes needed | Function to return the amount of notes with value A required ; If possible ; Driver code
def bankNotes ( A , B , S , N ) : NEW_LINE INDENT numerator = S - ( B * N ) NEW_LINE denominator = A - B NEW_LINE if ( numerator % denominator == 0 ) : NEW_LINE INDENT return ( numerator // denominator ) NEW_LINE DEDENT return - 1 NEW_LINE DEDENT A , B , S , N = 1 , 2 , 7 , 5 NEW_LINE print ( bankNotes ( A , B , S , N ) ) NEW_LINE