






# tests directory-specific settings - this file is run automatically
# by pytest before any tests are run

import sys
import warnings
from os.path import abspath, dirname, join


# allow having multiple repository checkouts and not needing to remember to rerun
# 'pip install -e .[dev]' when switching between checkouts and running tests.
snake_case_   :	List[str]							      =abspath(join(dirname(dirname(dirname(__file__))), '''src'''))
sys.path.insert(1, git_repo_path)


# silence FutureWarning warnings in tests since often we can't act on them until
# they become normal warnings - i.e. the tests still need to test the current functionality
warnings.simplefilter(action='''ignore''', category=FutureWarning)



def      UpperCAmelCase						( lowerCAmelCase__	):


		'''simple docstring'''

		from transformers.testing_utils import pytest_addoption_shared

		pytest_addoption_shared(lowerCAmelCase__	)





def      UpperCAmelCase						( lowerCAmelCase__	):


		'''simple docstring'''

		from transformers.testing_utils import pytest_terminal_summary_main

		__A    =							terminalreporter.config.getoption("--make-reports"	)
		if make_reports:
				pytest_terminal_summary_main(lowerCAmelCase__					,     id=lowerCAmelCase__	)



"""simple docstring"""




__lowerCAmelCase							:  Any 				=		{
    '''0''': 1,
    '''1''': 1,
    '''2''': 2,
    '''3''': 6,
    '''4''': 24,
    '''5''': 120,
    '''6''': 720,
    '''7''': 5040,
    '''8''': 40320,
    '''9''': 362880,
}

__lowerCAmelCase							:  List[Any] 				=		{145: 145}

__lowerCAmelCase							:  Any 				=		{
    145: 0,
    169: 3,
    36301: 3,
    1454: 3,
    871: 2,
    45361: 2,
    872: 2,
}

def __snake_case (      UpperCamelCase    )       ->    int:


		"""simple docstring"""





		if n in CACHE_SUM_DIGIT_FACTORIALS:
				return CACHE_SUM_DIGIT_FACTORIALS[n]
		a__   		=     sum(DIGIT_FACTORIALS[let] for let in str(UpperCamelCase    )    )
		a__   		=     ret
		return ret

def __snake_case (      UpperCamelCase						,					UpperCamelCase = None    )       ->    int:


		"""simple docstring"""





		a__   		=     previous or set()
		if n in CHAIN_LENGTH_CACHE:
				return CHAIN_LENGTH_CACHE[n]
		a__   		=     sum_digit_factorials(UpperCamelCase    )
		if next_number in previous:
				a__   		=     0
				return 0
		else:
				previous.add(UpperCamelCase    )
				a__   		=     1 + chain_length(UpperCamelCase						,					UpperCamelCase    )
				a__   		=     ret
				return ret

def __snake_case (      UpperCamelCase = 60						,					UpperCamelCase = 1_000_000    )       ->    int:


		"""simple docstring"""





		return sum(1 for i in range(1						,					UpperCamelCase    ) if chain_length(UpperCamelCase    ) == num_terms    )


if __name__ == "__main__":
					print(f"{solution() = }")




