






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












"""simple docstring"""





A__					: Tuple=	"""Alexander Joslin"""

import operator as op

from .stack import Stack







def   lowerCAmelCase_( SCREAMING_SNAKE_CASE					)					->	int:
    """simple docstring"""

    UpperCamelCase__         =    {'*': op.mul, '/': op.truediv, '+': op.add, '-': op.sub}

    UpperCamelCase__         =    Stack()
    UpperCamelCase__         =    Stack()

    for i in equation:
        if i.isdigit():
            # RULE 1
            operand_stack.push(int(SCREAMING_SNAKE_CASE					)					)
        elif i in operators:
            # RULE 2
            operator_stack.push(SCREAMING_SNAKE_CASE					)
        elif i == ")":
            # RULE 4
            UpperCamelCase__         =    operator_stack.peek()
            operator_stack.pop()
            UpperCamelCase__         =    operand_stack.peek()
            operand_stack.pop()
            UpperCamelCase__         =    operand_stack.peek()
            operand_stack.pop()

            UpperCamelCase__         =    operators[opr](SCREAMING_SNAKE_CASE ,	SCREAMING_SNAKE_CASE					)
            operand_stack.push(SCREAMING_SNAKE_CASE					)

    # RULE 5
    return operand_stack.peek()


if __name__ == "__main__":
  A__					: int=	"""(5 + ((4 * 2) * (2 + 3)))"""
  # answer = 45
  print(F"""{equation} = {dijkstras_two_stack_algorithm(equation)}""")




