
"""simple docstring"""




from __future__ import annotations

from math import ceil, floor, sqrt



def     __magic_name__		(					UpperCamelCase     :		int = 2000000     )     ->						int:
    a__		=			[0]
    a__		=			42

    for idx in range(1							,		ceil(sqrt(target * 2     ) * 1.1     )     ):
        triangle_numbers.append(triangle_numbers[-1] + idx     )

    # we want this to be as close as possible to target
    a__		=			0
    # the area corresponding to the grid that gives the product closest to target
    a__		=			0
    # an estimate of b, using the quadratic formula
    a__		=			42
    # the largest integer less than b_estimate
    a__		=			42
    # the largest integer less than b_estimate
    a__		=			42
    # the triangle number corresponding to b_floor
    a__		=			42
    # the triangle number corresponding to b_ceil
    a__		=			42

    for idx_a, triangle_a in enumerate(triangle_numbers[1:]							,		1     ):
        a__		=			(-1 + sqrt(1 + 8 * target / triangle_a     )) / 2
        a__		=			floor(UpperCamelCase     )
        a__		=			ceil(UpperCamelCase     )
        a__		=			triangle_numbers[b_floor]
        a__		=			triangle_numbers[b_ceil]

        if abs(target - triangle_b_first_guess * triangle_a     ) < abs(
            target - best_product     ):
            a__		=			triangle_b_first_guess * triangle_a
            a__		=			idx_a * b_floor

        if abs(target - triangle_b_second_guess * triangle_a     ) < abs(
            target - best_product     ):
            a__		=			triangle_b_second_guess * triangle_a
            a__		=			idx_a * b_ceil

    return area


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




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


