






from itertools import permutations





def 					lowercase_ (    __snake_case     :							tuple      )     -> bool:





				'''simple docstring'''


				if num[3] % 2 != 0:
								return False

				if (num[2] + num[3] + num[4]) % 3 != 0:
								return False

				if num[5] % 5 != 0:
								return False

				snake_case__      :int         =   [7, 11, 13, 17]
				for i, test in enumerate(__snake_case      ):
								if (num[i + 4] * 1_00 + num[i + 5] * 10 + num[i + 6]) % test != 0:
												return False
				return True





def 					lowercase_ (    __snake_case     :							int = 10      )     -> int:





				'''simple docstring'''


				return sum(
				    int("".join(map(__snake_case	,	__snake_case      )      )      )
				    for num in permutations(range(__snake_case      )      )
				    if is_substring_divisible(__snake_case      )      )


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







from __future__ import annotations

import math





def 					lowercase_ (    __snake_case     :							int	,	__snake_case     :							int	,	__snake_case     :							bool	,	__snake_case     :							list[int]	,	__snake_case     :							float      )     -> int:





				'''simple docstring'''


				if depth < 0:
								raise ValueError("Depth cannot be less than 0"      )

				if len(__snake_case      ) == 0:
								raise ValueError("Scores cannot be empty"      )

				if depth == height:
								return scores[node_index]

				if is_max:
								return max(
								    minimax(depth + 1	,	node_index * 2	,	__snake_case	,	__snake_case	,	__snake_case      )	,	minimax(depth + 1	,	node_index * 2 + 1	,	__snake_case	,	__snake_case	,	__snake_case      )	,	)

				return min(
				    minimax(depth + 1	,	node_index * 2	,	__snake_case	,	__snake_case	,	__snake_case      )	,	minimax(depth + 1	,	node_index * 2 + 1	,	__snake_case	,	__snake_case	,	__snake_case      )	,	)





def 					lowercase_ (    )     -> None:





				'''simple docstring'''


				snake_case__      :List[Any]         =   [90, 23, 6, 33, 21, 65, 1_23, 3_44_23]
				snake_case__      :int         =   math.log(len(__snake_case      )	,	2      )
				print("Optimal value : "	,	end=""      )
				print(minimax(0	,	0	,	__snake_case	,	__snake_case	,	__snake_case      )      )


if __name__ == "__main__":
	import doctest

	doctest.testmod()
	main()