





"""simple docstring"""






from __future__ import annotations

from collections.abc import Iterable, Iterator
from dataclasses import dataclass

lowerCAmelCase_			=							(3, 9, -11, 0, 7, 5, 1, -1)
lowerCAmelCase_			=							(4, 6, 2, 0, 8, 10, 3, -2)



@dataclass
class 	lowerCAmelCase					:
       lowerCAmelCase__						 =  42
       lowerCAmelCase__						 =  42



class 	lowerCAmelCase					:






       def __init__(   self    ,  a__     ):
              _UpperCAmelCase     =     None
              for i in sorted(a__    ,  reverse=a__     ):
                     _UpperCAmelCase     =     Node(a__    ,  self.head     )






       def __iter__(   self     ):
              _UpperCAmelCase     =     self.head
              while node:
                     yield node.data
                     _UpperCAmelCase     =     node.next_node






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






       def __str__(   self     ):
              return " -> ".join([str(a__     ) for node in self]     )


def       __lowerCamelCase    (       SCREAMING_SNAKE_CASE,SCREAMING_SNAKE_CASE							)		->       SortedLinkedList:






       """simple docstring"""




       return SortedLinkedList(list(SCREAMING_SNAKE_CASE							) + list(SCREAMING_SNAKE_CASE							)							)


if __name__ == "__main__":
    import doctest

    doctest.testmod()
    lowerCAmelCase_			=							SortedLinkedList
    print(merge_lists(SSL(test_data_odd), SSL(test_data_even)))













"""simple docstring"""






from itertools import product

def       __lowerCamelCase    (       SCREAMING_SNAKE_CASE,SCREAMING_SNAKE_CASE							)		->       list[int]:






       """simple docstring"""




       _UpperCAmelCase     =     sides_number
       _UpperCAmelCase     =     max_face_number * dice_number
       _UpperCAmelCase     =     [0] * (max_total + 1)

       _UpperCAmelCase     =     1
       _UpperCAmelCase     =     range(SCREAMING_SNAKE_CASE,max_face_number + 1							)
       for dice_numbers in product(SCREAMING_SNAKE_CASE,repeat=SCREAMING_SNAKE_CASE							):
              _UpperCAmelCase     =     sum(SCREAMING_SNAKE_CASE							)
              totals_frequencies[total] += 1

       return totals_frequencies

def       __lowerCamelCase    (       )		->       float:






       """simple docstring"""




       _UpperCAmelCase     =     total_frequency_distribution(
           sides_number=4,dice_number=9							)
       _UpperCAmelCase     =     total_frequency_distribution(
           sides_number=6,dice_number=6							)

       _UpperCAmelCase     =     0
       _UpperCAmelCase     =     9
       _UpperCAmelCase     =     4 * 9
       _UpperCAmelCase     =     6
       for peter_total in range(SCREAMING_SNAKE_CASE,max_peter_total + 1							):
              peter_wins_count += peter_totals_frequencies[peter_total] * sum(
                  colin_totals_frequencies[min_colin_total:peter_total]							)

       _UpperCAmelCase     =     (4**9) * (6**6)
       _UpperCAmelCase     =     peter_wins_count / total_games_number

       _UpperCAmelCase     =     round(SCREAMING_SNAKE_CASE,ndigits=7							)

       return rounded_peter_win_probability


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






