



"""simple docstring"""




import random

from .binary_exp_mod import bin_exp_mod




def      __UpperCamelCase     (  _lowerCAmelCase				,					_lowerCAmelCase=1000		)	->  Any:



    """simple docstring"""






    if n < 2:
        return False

    if n % 2 == 0:
        return n == 2

    # this means n is odd
    A			:	int										=       n - 1
    A			:	Union[str, Any]										=       0
    while d % 2 == 0:
        d /= 2
        exp += 1

    # n - 1=d*(2**exp)
    A			:	List[str]										=       0
    while count < prec:
        A			:	Dict										=       random.randint(2				,					n - 1		)
        A			:	int										=       bin_exp_mod(__lowerCamelCase				,					__lowerCamelCase				,					__lowerCamelCase		)
        if b != 1:
            A			:	Optional[int]										=       True
            for _ in range(__lowerCamelCase		):
                if b == n - 1:
                    A			:	Any										=       False
                    break
                A			:	List[str]										=       b * b
                b %= n
            if flag:
                return False
            count += 1
    return True


if __name__ == "__main__":
     SCREAMING_SNAKE_CASE_:Union[str, Any]					=						abs(int(input("""Enter bound : """).strip()))
     print("""Here\'s the list of primes:""")
     print(""", """.join(str(i) for i in range(n + 1) if is_prime_big(i)))







from collections import defaultdict

from graphs.minimum_spanning_tree_prims import prisms_algorithm as mst




def      __UpperCamelCase     (  )	->  Tuple:



    """simple docstring"""






    A					,							A			:	Tuple										=       9, 14  # noqa: F841
    A			:	Optional[int]										=       [
        [0, 1, 4],
        [0, 7, 8],
        [1, 2, 8],
        [7, 8, 7],
        [7, 6, 1],
        [2, 8, 2],
        [8, 6, 6],
        [2, 3, 7],
        [2, 5, 4],
        [6, 5, 2],
        [3, 5, 14],
        [3, 4, 9],
        [5, 4, 10],
        [1, 7, 11],
    ]

    A			:	int										=       defaultdict(_lowerCAmelCase		)
    for nodea, nodea, cost in edges:
        adjancency[nodea].append([nodea, cost]		)
        adjancency[nodea].append([nodea, cost]		)

    A			:	List[str]										=       mst(_lowerCAmelCase		)

    A			:	str										=       [
        [7, 6, 1],
        [2, 8, 2],
        [6, 5, 2],
        [0, 1, 4],
        [2, 5, 4],
        [2, 3, 7],
        [0, 7, 8],
        [3, 4, 9],
    ]

    for answer in expected:
        A			:	Dict										=       tuple(answer[:2]		)
        A			:	List[str]										=       tuple(edge[::-1]		)
        assert edge in result or reverse in result


