





'''simple docstring'''






import unittest
from timeit import timeit
def      UpperCamelCase__   (	lowerCAmelCase							,			lowerCAmelCase						):





      """simple docstring"""


      _lowerCAmelCase							  =							first_num if first_num >= second_num else second_num
      _lowerCAmelCase							  =							max_num
      while (common_mult % first_num > 0) or (common_mult % second_num > 0):
            common_mult += max_num
      return common_mult
def      UpperCamelCase__   (	lowerCAmelCase							,			lowerCAmelCase						):





      """simple docstring"""


      return b if a == 0 else greatest_common_divisor(b % a							,			lowerCAmelCase						)
def      UpperCamelCase__   (	lowerCAmelCase							,			lowerCAmelCase						):





      """simple docstring"""


      return first_num // greatest_common_divisor(lowerCAmelCase							,			lowerCAmelCase						) * second_num
def      UpperCamelCase__   (	):





      """simple docstring"""


      _lowerCAmelCase							  =							(
          """from __main__ import least_common_multiple_slow, least_common_multiple_fast"""
      )
      print(
          """least_common_multiple_slow():"""							,			timeit("""least_common_multiple_slow(1000, 999)"""							,			setup=lowerCAmelCase						)							,			)
      print(
          """least_common_multiple_fast():"""							,			timeit("""least_common_multiple_fast(1000, 999)"""							,			setup=lowerCAmelCase						)							,			)




class 				UpperCAmelCase  (    unittest.TestCase     ):
      _lowercase:    int		  =     (
          (10, 20),
          (13, 15),
          (4, 31),
          (10, 42),
          (43, 34),
          (5, 12),
          (12, 25),
          (10, 25),
          (6, 9),
      )
      _lowercase:    Optional[int]		  =     (20, 195, 124, 210, 1462, 60, 300, 50, 18)




      def        lowercase__					(    self    :				Any						)       ->   str:
            for i, (first_num, second_num) in enumerate(self.test_inputs						):
                  _lowerCAmelCase							  =							least_common_multiple_slow(__snake_case    ,    __snake_case						)
                  _lowerCAmelCase							  =							least_common_multiple_fast(__snake_case    ,    __snake_case						)
                  with self.subTest(i=__snake_case						):
                        self.assertEqual(__snake_case    ,    self.expected_results[i]						)
                        self.assertEqual(__snake_case    ,    self.expected_results[i]						)


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













'''simple docstring'''






class 				UpperCAmelCase  :




      def __init__(    self    :				Optional[Any]						)       ->   List[str]:
            _lowerCAmelCase							  =							[0]
            _lowerCAmelCase							  =							0




      def        lowercase__					(    self    :				str    ,    __snake_case    :				int						)       ->   None:
            _lowerCAmelCase							  =							self.__heap[i]
            while i // 2 > 0:
                  if self.__heap[i] > self.__heap[i // 2]:
                        _lowerCAmelCase							  =							self.__heap[i // 2]
                        _lowerCAmelCase							  =							temporary
                  i //= 2




      def        lowercase__					(    self    :				Optional[Any]    ,    __snake_case    :				int						)       ->   None:
            self.__heap.append(__snake_case						)
            self.__size += 1
            self.__swap_up(self.__size						)




      def        lowercase__					(    self    :				str    ,    __snake_case    :				int						)       ->   None:
            while self.__size >= 2 * i:
                  if 2 * i + 1 > self.__size:
                        _lowerCAmelCase							  =							2 * i
                  else:
                        if self.__heap[2 * i] > self.__heap[2 * i + 1]:
                              _lowerCAmelCase							  =							2 * i
                        else:
                              _lowerCAmelCase							  =							2 * i + 1
                  _lowerCAmelCase							  =							self.__heap[i]
                  if self.__heap[i] < self.__heap[bigger_child]:
                        _lowerCAmelCase							  =							self.__heap[bigger_child]
                        _lowerCAmelCase							  =							temporary
                  _lowerCAmelCase							  =							bigger_child




      def        lowercase__					(    self    :				Tuple						)       ->   int:
            _lowerCAmelCase							  =							self.__heap[1]
            _lowerCAmelCase							  =							self.__heap[self.__size]
            self.__size -= 1
            self.__heap.pop()
            self.__swap_down(1						)
            return max_value




      @property
      def        lowercase__					(    self    :				List[Any]						)       ->   str:
            return self.__heap[1:]




      def __len__(    self    :				Optional[Any]						)       ->   str:
            return self.__size


if __name__ == "__main__":
      import doctest

      doctest.testmod()
      # create an instance of BinaryHeap
      A__       :     Tuple          =BinaryHeap()
      binary_heap.insert(6)
      binary_heap.insert(10)
      binary_heap.insert(15)
      binary_heap.insert(12)
      # pop root(max-values because it is max heap)
      print(binary_heap.pop())  # 15
      print(binary_heap.pop())  # 12
      # get the list and size after operations
      print(binary_heap.get_list)
      print(len(binary_heap))






