

class 							a__							:







  """simple docstring"""




  def __init__(      self     :			str					,					UpperCAmelCase__     :			int		)       ->None:
        """simple docstring"""







        SCREAMING_SNAKE_CASE			:   int	  = data
        SCREAMING_SNAKE_CASE			:   int	  = 4_2
        SCREAMING_SNAKE_CASE			:   Dict	  = 4_2






def        __lowercase   (  _A      )  ->    None:
      SCREAMING_SNAKE_CASE			:   List[str]	  = 0
      SCREAMING_SNAKE_CASE			:   Tuple	  = x






def        __lowercase   (  _A    ,     _A      )  ->    None:
      SCREAMING_SNAKE_CASE  ,						SCREAMING_SNAKE_CASE			:   Tuple	  = find_set(__UpperCAmelCase      ), find_set(__UpperCAmelCase      )
      if x == y:
            return

      elif x.rank > y.rank:
            SCREAMING_SNAKE_CASE			:   str	  = x
      else:
            SCREAMING_SNAKE_CASE			:   Dict	  = y
            if x.rank == y.rank:
                  y.rank += 1






def        __lowercase   (  _A      )  ->    Node:






      if x != x.parent:
            SCREAMING_SNAKE_CASE			:   Tuple	  = find_set(x.parent      )
      return x.parent






def        __lowercase   (  _A      )  ->    set:
      SCREAMING_SNAKE_CASE			:   Any	  = ({0, 1, 2}, {3, 4, 5})
      for s in sets:
            if node.data in s:
                  return s
      SCREAMING_SNAKE_CASE			:   int	  = F"{node.data} is not in {sets}"
      raise ValueError(__UpperCAmelCase      )






def        __lowercase   (  )  ->    None:
      SCREAMING_SNAKE_CASE			:   Tuple	  = [Node(__UpperCAmelCase      ) for i in range(6      )]
      for v in vertex:
            make_set(__UpperCAmelCase      )

      union_set(vertex[0]    ,     vertex[1]      )
      union_set(vertex[1]    ,     vertex[2]      )
      union_set(vertex[3]    ,     vertex[4]      )
      union_set(vertex[3]    ,     vertex[5]      )

      for nodea in vertex:
            for nodea in vertex:
                  if find_python_set(__UpperCAmelCase      ).isdisjoint(find_python_set(__UpperCAmelCase      )      ):
                        assert find_set(__UpperCAmelCase      ) != find_set(__UpperCAmelCase      )
                  else:
                        assert find_set(__UpperCAmelCase      ) == find_set(__UpperCAmelCase      )


if __name__ == "__main__":
  test_disjoint_set()









import random







class 				a_    :

						def __init__(       self      :Union[str, Any]  ,		_lowercase      :float  ,		_lowercase      :float)						->   None:
												UpperCAmelCase_					=	x
												UpperCAmelCase_					=	y

						def       __a			(       self      :str)						->   bool:
												return (self.x**2 + self.y**2) <= 1




						@classmethod
						def       __a			(       cls      :Optional[Any])						->   str:
												return cls(x=random.random()  ,		y=random.random())







def 							A     (						__UpperCAmelCase      )			->			float:



						'''simple docstring'''






						if number_of_simulations < 1:
												raise ValueError('''At least one simulation is necessary to estimate PI.'''      )

						UpperCAmelCase_					=	0
						for _ in range(__UpperCAmelCase      ):
												UpperCAmelCase_					=	Point.random_unit_square()

												if random_point.is_in_unit_circle():
																		number_in_unit_circle += 1

						return 4 * number_in_unit_circle / number_of_simulations


if __name__ == "__main__":
							# import doctest

							# doctest.testmod()
							from math import pi

							UpperCamelCase_      			=  "Please enter the desired number of Monte Carlo simulations: "
							UpperCamelCase_      			=  estimate_pi(int(input(prompt).strip()))
							print(f"An estimate of PI is {my_pi} with an error of {abs(my_pi - pi)}")





