





"""simple docstring"""






def       __lowerCamelCase    (       SCREAMING_SNAKE_CASE							)		->       List[Any]:






       """simple docstring"""




       _UpperCAmelCase     =     abs(__lowerCAmelCase							)
       _UpperCAmelCase     =     0
       while n > 0:
              res += n % 10
              n //= 10
       return res

def       __lowerCamelCase    (       SCREAMING_SNAKE_CASE							)		->       Optional[Any]:






       """simple docstring"""




       _UpperCAmelCase     =     abs(__lowerCAmelCase							)
       return n if n < 10 else n % 10 + sum_of_digits(n // 10							)

def       __lowerCamelCase    (       SCREAMING_SNAKE_CASE							)		->       str:






       """simple docstring"""




       return sum(int(__lowerCAmelCase							) for c in str(abs(__lowerCAmelCase							)							)							)

def       __lowerCamelCase    (       )		->       List[Any]:






       """simple docstring"""




       from collections.abc import Callable
       from timeit import timeit

       def benchmark_a_function(SCREAMING_SNAKE_CASE,SCREAMING_SNAKE_CASE							) -> None:
              _UpperCAmelCase     =     F"""{func.__name__}({value})"""
              _UpperCAmelCase     =     timeit(F"""__main__.{call}""",setup='import __main__'							)
              print(F"""{call:56} = {func(__lowerCAmelCase							)} -- {timing:.4f} seconds"""							)

       for value in (262144, 1125899906842624, 1267650600228229401496703205376):
              for func in (sum_of_digits, sum_of_digits_recursion, sum_of_digits_compact):
                     benchmark_a_function(__lowerCAmelCase,__lowerCAmelCase							)
              print()


if __name__ == "__main__":
    import doctest

    doctest.testmod()
    benchmark()













"""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() = }''')






