Function to factorize using spf and store in cnt
def factorize ( f ) : NEW_LINE INDENT while ( f > 1 ) : NEW_LINE INDENT x = spf [ f ] NEW_LINE while ( f % x == 0 ) : NEW_LINE INDENT cnt [ x ] += 1 NEW_LINE f = int ( f / x ) NEW_LINE DEDENT DEDENT DEDENT