




"""simple docstring"""

import unittest
from timeit import timeit

def 		lowercase_   (		_UpperCAmelCase	,   _UpperCAmelCase						):




	"""simple docstring"""






	A_	:					List[Any]						 =		first_num if first_num >= second_num else second_num
	A_	:					List[str]						 =		max_num
	while (common_mult % first_num > 0) or (common_mult % second_num > 0):
		common_mult += max_num
	return common_mult

def 		lowercase_   (		_UpperCAmelCase	,   _UpperCAmelCase						):




	"""simple docstring"""






	return b if a == 0 else greatest_common_divisor(b % a	,   _UpperCAmelCase						)

def 		lowercase_   (		_UpperCAmelCase	,   _UpperCAmelCase						):




	"""simple docstring"""






	return first_num // greatest_common_divisor(_UpperCAmelCase	,   _UpperCAmelCase						) * second_num

def 		lowercase_   (		):




	"""simple docstring"""






	A_	:					int						 =		(
	    '''from __main__ import least_common_multiple_slow, least_common_multiple_fast'''
	)
	print(
	    '''least_common_multiple_slow():'''	,   timeit('''least_common_multiple_slow(1000, 999)'''	,   setup=_UpperCAmelCase						)	,   )
	print(
	    '''least_common_multiple_fast():'''	,   timeit('''least_common_multiple_fast(1000, 999)'''	,   setup=_UpperCAmelCase						)	,   )

class 							lowercase   (     unittest.TestCase):
				__lowerCAmelCase     :     int								= (
				    (10, 20),
				    (13, 15),
				    (4, 31),
				    (10, 42),
				    (43, 34),
				    (5, 12),
				    (12, 25),
				    (10, 25),
				    (6, 9),
				)
				__lowerCAmelCase     :     List[Any]								= (20, 195, 124, 210, 1_462, 60, 300, 50, 18)







				def        a_	(				self :       Union[str, Any]							):



					"""simple docstring"""

					for i, (first_num, second_num) in enumerate(self.test_inputs							):
						A_	:					Union[str, Any]						 =		least_common_multiple_slow(_lowerCamelCase   ,  _lowerCamelCase							)
						A_	:					Tuple						 =		least_common_multiple_fast(_lowerCamelCase   ,  _lowerCamelCase							)
						with self.subTest(i=_lowerCamelCase							):
							self.assertEqual(_lowerCamelCase   ,  self.expected_results[i]							)
							self.assertEqual(_lowerCamelCase   ,  self.expected_results[i]							)


if __name__ == "__main__":
		benchmark()
		unittest.main()











"""simple docstring"""

class 							lowercase   :







				def __init__(				self :       Union[str, Any]   ,  _lowerCamelCase :       int							):



					"""simple docstring"""

					A_	:					Optional[int]						 =		data
					A_	:					int
					A_	:					Node

def 		lowercase_   (		_UpperCAmelCase						):




	"""simple docstring"""






	A_	:					List[str]						 =		0
	A_	:					List[str]						 =		x

def 		lowercase_   (		_UpperCAmelCase	,   _UpperCAmelCase						):




	"""simple docstring"""






	A_ ,			A_	:					Any						 =		find_set(_UpperCAmelCase						), find_set(_UpperCAmelCase						)
	if x == y:
		return

	elif x.rank > y.rank:
		A_	:					Optional[int]						 =		x
	else:
		A_	:					Optional[int]						 =		y
		if x.rank == y.rank:
			y.rank += 1

def 		lowercase_   (		_UpperCAmelCase						):




	"""simple docstring"""






	if x != x.parent:
		A_	:					Union[str, Any]						 =		find_set(x.parent						)
	return x.parent

def 		lowercase_   (		_UpperCAmelCase						):




	"""simple docstring"""






	A_	:					str						 =		({0, 1, 2}, {3, 4, 5})
	for s in sets:
		if node.data in s:
			return s
	A_	:					Optional[int]						 =		f"""{node.data} is not in {sets}"""
	raise ValueError(_UpperCAmelCase						)

def 		lowercase_   (		):




	"""simple docstring"""






	A_	:					Dict						 =		[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()





