

"""simple docstring"""


from itertools import product






def    a__   (   __SCREAMING_SNAKE_CASE ,			__SCREAMING_SNAKE_CASE			)     ->     Any:
		__lowerCAmelCase:	str   				=      sides_number
		__lowerCAmelCase:	int   				=      max_face_number * dice_number
		__lowerCAmelCase:	Union[str, Any]   				=      [0] * (max_total + 1)

		__lowerCAmelCase:	str   				=      1
		__lowerCAmelCase:	Union[str, Any]   				=      range(__lowerCamelCase ,			max_face_number + 1			)
		for dice_numbers in product(__lowerCamelCase ,			repeat=__lowerCamelCase			):
				__lowerCAmelCase:	int   				=      sum(__lowerCamelCase			)
				totals_frequencies[total] += 1

		return totals_frequencies






def    a__   (   )     ->     int:
		__lowerCAmelCase:	str   				=      total_frequency_distribution(
		    sides_number=4 ,			dice_number=9			)
		__lowerCAmelCase:	Dict   				=      total_frequency_distribution(
		    sides_number=6 ,			dice_number=6			)

		__lowerCAmelCase:	List[str]   				=      0
		__lowerCAmelCase:	Union[str, Any]   				=      9
		__lowerCAmelCase:	Optional[int]   				=      4 * 9
		__lowerCAmelCase:	int   				=      6
		for peter_total in range(__lowerCamelCase ,			max_peter_total + 1			):
				peter_wins_count += peter_totals_frequencies[peter_total] * sum(
				    colin_totals_frequencies[min_colin_total:peter_total]			)

		__lowerCAmelCase:	Optional[int]   				=      (4**9) * (6**6)
		__lowerCAmelCase:	Dict   				=      peter_wins_count / total_games_number

		__lowerCAmelCase:	Tuple   				=      round(__lowerCamelCase ,			ndigits=7			)

		return rounded_peter_win_probability


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





"""simple docstring"""


import math
import sys






def    a__   (   __SCREAMING_SNAKE_CASE			)     ->     int:
		if number != int(__SCREAMING_SNAKE_CASE			):
				raise ValueError("the value of input must be a natural number"			)
		if number < 0:
				raise ValueError("the value of input must not be a negative number"			)
		if number == 0:
				return 1
		__lowerCAmelCase:	int   				=      [-1] * (number + 1)
		__lowerCAmelCase:	Optional[Any]   				=      0
		for i in range(1 ,			number + 1			):
				__lowerCAmelCase:	List[str]   				=      sys.maxsize
				__lowerCAmelCase:	int   				=      int(math.sqrt(__SCREAMING_SNAKE_CASE			)			)
				for j in range(1 ,			root + 1			):
						__lowerCAmelCase:	Optional[Any]   				=      1 + answers[i - (j**2)]
						__lowerCAmelCase:	List[Any]   				=      min(__SCREAMING_SNAKE_CASE ,			__SCREAMING_SNAKE_CASE			)
				__lowerCAmelCase:	Optional[Any]   				=      answer
		return answers[number]


if __name__ == "__main__":
			import doctest

			doctest.testmod()


