






"""simple docstring"""







from itertools import product





def 						lowercase__(A ,		A						)    ->str:




						"""simple docstring"""



						lowercase__    :				int=	sides_number
						lowercase__    :				Optional[int]=	max_face_number * dice_number
						lowercase__    :				int=	[0] * (max_total + 1)

						lowercase__    :				int=	1
						lowercase__    :				List[str]=	range(__a ,		max_face_number + 1						)
						for dice_numbers in product(__a ,		repeat=__a						):
												lowercase__    :				int=	sum(__a						)
												totals_frequencies[total] += 1

						return totals_frequencies





def 						lowercase__()    ->Any:




						"""simple docstring"""



						lowercase__    :				Union[str, Any]=	total_frequency_distribution(
						    sides_number=4 ,		dice_number=9						)
						lowercase__    :				int=	total_frequency_distribution(
						    sides_number=6 ,		dice_number=6						)

						lowercase__    :				Dict=	0
						lowercase__    :				Dict=	9
						lowercase__    :				Tuple=	4 * 9
						lowercase__    :				List[Any]=	6
						for peter_total in range(__a ,		max_peter_total + 1						):
												peter_wins_count += peter_totals_frequencies[peter_total] * sum(
												    colin_totals_frequencies[min_colin_total:peter_total]						)

						lowercase__    :				Tuple=	(4**9) * (6**6)
						lowercase__    :				List[str]=	peter_wins_count / total_games_number

						lowercase__    :				Union[str, Any]=	round(__a ,		ndigits=7						)

						return rounded_peter_win_probability


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














"""simple docstring"""







from __future__ import annotations

from collections.abc import Iterator
from typing import Any


class    __UpperCAmelCase:




						"""simple docstring"""




						def __init__(       self	,  snake_case__      ):
												'''simple docstring'''
												lowercase__    :				Any=	data
												lowercase__    :				Node | None=	None


class    __UpperCAmelCase:




						"""simple docstring"""




						def __init__(       self      ):
												'''simple docstring'''
												lowercase__    :				List[str]=	None
												lowercase__    :				int=	None




						def __iter__(       self      ):
												'''simple docstring'''
												lowercase__    :				Any=	self.head
												while self.head:
																		yield node.data
																		lowercase__    :				str=	node.next
																		if node == self.head:
																								break




						def __len__(       self      ):
												'''simple docstring'''
												return sum(1 for _ in self      )




						def __repr__(       self      ):
												'''simple docstring'''
												return "->".join(str(snake_case__      ) for item in iter(self      )      )




						def 		UpperCAmelCase_	(       self	,  snake_case__      ):
												'''simple docstring'''
												self.insert_nth(len(self      )	,  snake_case__      )




						def 		UpperCAmelCase_	(       self	,  snake_case__      ):
												'''simple docstring'''
												self.insert_nth(0	,  snake_case__      )




						def 		UpperCAmelCase_	(       self	,  snake_case__	,  snake_case__      ):
												'''simple docstring'''
												if index < 0 or index > len(self      ):
																		raise IndexError("list index out of range."      )
												lowercase__    :				Optional[Any]=	Node(snake_case__      )
												if self.head is None:
																		lowercase__    :				Tuple=	new_node  # first node points itself
																		lowercase__    :				str=	new_node
												elif index == 0:  # insert at head
																		lowercase__    :				Dict=	self.head
																		lowercase__    :				int=	new_node
												else:
																		lowercase__    :				Dict=	self.head
																		for _ in range(index - 1      ):
																								lowercase__    :				Any=	temp.next
																		lowercase__    :				str=	temp.next
																		lowercase__    :				Dict=	new_node
																		if index == len(self      ) - 1:  # insert at tail
																								lowercase__    :				int=	new_node




						def 		UpperCAmelCase_	(       self      ):
												'''simple docstring'''
												return self.delete_nth(0      )




						def 		UpperCAmelCase_	(       self      ):
												'''simple docstring'''
												return self.delete_nth(len(self      ) - 1      )




						def 		UpperCAmelCase_	(       self	,  snake_case__ = 0      ):
												'''simple docstring'''
												if not 0 <= index < len(self      ):
																		raise IndexError("list index out of range."      )
												lowercase__    :				int=	self.head
												if self.head == self.tail:  # just one node
																		lowercase__    :				Union[str, Any]=	None
												elif index == 0:  # delete head node
																		lowercase__    :				Tuple=	self.tail.next.next
																		lowercase__    :				Union[str, Any]=	self.head.next
												else:
																		lowercase__    :				Union[str, Any]=	self.head
																		for _ in range(index - 1      ):
																								lowercase__    :				Dict=	temp.next
																		lowercase__    :				List[str]=	temp.next
																		lowercase__    :				Optional[Any]=	temp.next.next
																		if index == len(self      ) - 1:  # delete at tail
																								lowercase__    :				Optional[Any]=	temp
												return delete_node.data




						def 		UpperCAmelCase_	(       self      ):
												'''simple docstring'''
												return len(self      ) == 0





def 						lowercase__()    ->None:




						"""simple docstring"""



						lowercase__    :				Dict=	CircularLinkedList()
						assert len(A						) == 0
						assert circular_linked_list.is_empty() is True
						assert str(A						) == ""

						try:
												circular_linked_list.delete_front()
												raise AssertionError  # This should not happen
						except IndexError:
												assert True  # This should happen

						try:
												circular_linked_list.delete_tail()
												raise AssertionError  # This should not happen
						except IndexError:
												assert True  # This should happen

						try:
												circular_linked_list.delete_nth(-1						)
												raise AssertionError
						except IndexError:
												assert True

						try:
												circular_linked_list.delete_nth(0						)
												raise AssertionError
						except IndexError:
												assert True

						assert circular_linked_list.is_empty() is True
						for i in range(5						):
												assert len(A						) == i
												circular_linked_list.insert_nth(A ,		i + 1						)
						assert str(A						) == "->".join(str(A						) for i in range(1 ,		6						)						)

						circular_linked_list.insert_tail(6						)
						assert str(A						) == "->".join(str(A						) for i in range(1 ,		7						)						)
						circular_linked_list.insert_head(0						)
						assert str(A						) == "->".join(str(A						) for i in range(0 ,		7						)						)

						assert circular_linked_list.delete_front() == 0
						assert circular_linked_list.delete_tail() == 6
						assert str(A						) == "->".join(str(A						) for i in range(1 ,		6						)						)
						assert circular_linked_list.delete_nth(2						) == 3

						circular_linked_list.insert_nth(2 ,		3						)
						assert str(A						) == "->".join(str(A						) for i in range(1 ,		6						)						)

						assert circular_linked_list.is_empty() is False


if __name__ == "__main__":
			import doctest

			doctest.testmod()






