
"""simple docstring"""
from __future__ import annotations

lowercase_							:    int         =						[-10, -5, 0, 5, 5.1, 11, 13, 21, 3, 4, -21, -10, -5, -1, 0]
lowercase_							:    Dict         =						[-5, 0, 5, 5.1, 11, 13, 21, -1, 4, -1, -10, -5, -1, 0, -1]





def  _lowerCAmelCase     (  lowerCamelCase__				:				list[float]					)	->     list[float]:
  _SCREAMING_SNAKE_CASE :					List[str]				     =			[]
  _SCREAMING_SNAKE_CASE :					Optional[int]				     =			len(lowerCamelCase__					)

  for i in range(lowerCamelCase__					):
    _SCREAMING_SNAKE_CASE :					Optional[int]				     =			-1
    for j in range(i + 1,    lowerCamelCase__					):
      if arr[i] < arr[j]:
        _SCREAMING_SNAKE_CASE :					Tuple				     =			arr[j]
        break
    result.append(lowerCamelCase__					)
  return result





def  _lowerCAmelCase     (  lowerCamelCase__				:				list[float]					)	->     list[float]:
  _SCREAMING_SNAKE_CASE :					List[str]				     =			[]
  for i, outer in enumerate(lowerCamelCase__					):
    _SCREAMING_SNAKE_CASE :					Optional[int]				     =			-1
    for inner in arr[i + 1 :]:
      if outer < inner:
        _SCREAMING_SNAKE_CASE :					Dict				     =			inner
        break
    result.append(lowerCamelCase__					)
  return result





def  _lowerCAmelCase     (  lowerCamelCase__				:				list[float]					)	->     list[float]:
  _SCREAMING_SNAKE_CASE :					Tuple				     =			len(lowerCamelCase__					)
  _SCREAMING_SNAKE_CASE :					Optional[int]				     =			[]
  _SCREAMING_SNAKE_CASE :					str				     =			[-1] * arr_size

  for index in reversed(range(lowerCamelCase__					)					):
    if stack:
      while stack[-1] <= arr[index]:
        stack.pop()
        if not stack:
          break
    if stack:
      _SCREAMING_SNAKE_CASE :					Union[str, Any]				     =			stack[-1]
    stack.append(arr[index]					)
  return result


if __name__ == "__main__":
      from doctest import testmod
      from timeit import timeit

      testmod()
      print(next_greatest_element_slow(arr))
      print(next_greatest_element_fast(arr))
      print(next_greatest_element(arr))

      lowercase_							:    Optional[Any]         =						(
          'from __main__ import arr, next_greatest_element_slow, '
          'next_greatest_element_fast, next_greatest_element'
      )
      print(
          '''next_greatest_element_slow():''',
          timeit('''next_greatest_element_slow(arr)''', setup=setup),
      )
      print(
          '''next_greatest_element_fast():''',
          timeit('''next_greatest_element_fast(arr)''', setup=setup),
      )
      print(
          '''     next_greatest_element():''',
          timeit('''next_greatest_element(arr)''', setup=setup),
      )





"""simple docstring"""




from itertools import product



def     __magic_name__		(					UpperCamelCase     :		int							,		UpperCamelCase     :		int     )     ->						list[int]:
    a__		=			sides_number
    a__		=			max_face_number * dice_number
    a__		=			[0] * (max_total + 1)

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

    return totals_frequencies



def     __magic_name__		(					)     ->						float:
    a__		=			total_frequency_distribution(
        sides_number=4							,		dice_number=9     )
    a__		=			total_frequency_distribution(
        sides_number=6							,		dice_number=6     )

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

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

    a__		=			round(UpperCamelCase							,		ndigits=7     )

    return rounded_peter_win_probability


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


