






import math







def 		SCREAMING_SNAKE_CASE							( __lowerCAmelCase ,   __lowerCAmelCase = 0 ,   __lowerCAmelCase = 0      )			->     list:
     UpperCamelCase__      :       Dict	    =  end or len(__lowerCAmelCase      )
     for i in range(__lowerCAmelCase ,   __lowerCAmelCase      ):
          UpperCamelCase__      :       int	    =  i
          UpperCamelCase__      :       Tuple	    =  array[i]
          while temp_index != start and temp_index_value < array[temp_index - 1]:
               UpperCamelCase__      :       Optional[Any]	    =  array[temp_index - 1]
               temp_index -= 1
          UpperCamelCase__      :       Optional[int]	    =  temp_index_value
     return array







def 		SCREAMING_SNAKE_CASE							( __lowerCAmelCase ,   __lowerCAmelCase ,   __lowerCAmelCase      )			->     None:  # Max Heap
     UpperCamelCase__      :       Dict	    =  index
     UpperCamelCase__      :       List[Any]	    =  2 * index + 1  # Left Node
     UpperCamelCase__      :       Any	    =  2 * index + 2  # Right Node

     if left_index < heap_size and array[largest] < array[left_index]:
          UpperCamelCase__      :       Optional[Any]	    =  left_index

     if right_index < heap_size and array[largest] < array[right_index]:
          UpperCamelCase__      :       Dict	    =  right_index

     if largest != index:
          UpperCamelCase__      :       Any	    =  array[largest], array[index]
          heapify(__lowerCAmelCase ,   __lowerCAmelCase ,   __lowerCAmelCase      )







def 		SCREAMING_SNAKE_CASE							( __lowerCAmelCase      )			->     list:
     UpperCamelCase__      :       Any	    =  len(__lowerCAmelCase      )

     for i in range(n // 2 ,   -1 ,   -1      ):
          heapify(__lowerCAmelCase ,   __lowerCAmelCase ,   __lowerCAmelCase      )

     for i in range(n - 1 ,   0 ,   -1      ):
          UpperCamelCase__      :       Optional[Any]	    =  array[0], array[i]
          heapify(__lowerCAmelCase ,   0 ,   __lowerCAmelCase      )

     return array







def 		SCREAMING_SNAKE_CASE							( __lowerCAmelCase ,   __lowerCAmelCase ,   __lowerCAmelCase ,   __lowerCAmelCase      )			->     int:
     if (array[first_index] > array[middle_index]) != (
         array[first_index] > array[last_index]
     ):
          return array[first_index]
     elif (array[middle_index] > array[first_index]) != (
         array[middle_index] > array[last_index]
     ):
          return array[middle_index]
     else:
          return array[last_index]







def 		SCREAMING_SNAKE_CASE							( __lowerCAmelCase ,   __lowerCAmelCase ,   __lowerCAmelCase ,   __lowerCAmelCase      )			->     int:
     UpperCamelCase__      :       List[Any]	    =  low
     UpperCamelCase__      :       Optional[int]	    =  high
     while True:
          while array[i] < pivot:
               i += 1
          j -= 1
          while pivot < array[j]:
               j -= 1
          if i >= j:
               return i
          UpperCamelCase__      :       Optional[Any]	    =  array[j], array[i]
          i += 1







def 		SCREAMING_SNAKE_CASE							( __lowerCAmelCase      )			->     list:
     if len(__lowerCAmelCase      ) == 0:
          return array
     UpperCamelCase__      :       Optional[int]	    =  2 * math.ceil(math.loga(len(__lowerCAmelCase      )      )      )
     UpperCamelCase__      :       Tuple	    =  16
     return intro_sort(__lowerCAmelCase ,   0 ,   len(__lowerCAmelCase      ) ,   __lowerCAmelCase ,   __lowerCAmelCase      )







def 		SCREAMING_SNAKE_CASE							( __lowerCAmelCase ,   __lowerCAmelCase ,   __lowerCAmelCase ,   __lowerCAmelCase ,   __lowerCAmelCase      )			->     list:
     while end - start > size_threshold:
          if max_depth == 0:
               return heap_sort(__lowerCAmelCase      )
          max_depth -= 1
          UpperCamelCase__      :       int	    =  median_of_a(__lowerCAmelCase ,   __lowerCAmelCase ,   start + ((end - start) // 2) + 1 ,   end - 1      )
          UpperCamelCase__      :       Any	    =  partition(__lowerCAmelCase ,   __lowerCAmelCase ,   __lowerCAmelCase ,   __lowerCAmelCase      )
          intro_sort(__lowerCAmelCase ,   __lowerCAmelCase ,   __lowerCAmelCase ,   __lowerCAmelCase ,   __lowerCAmelCase      )
          UpperCamelCase__      :       str	    =  p
     return insertion_sort(__lowerCAmelCase ,   __lowerCAmelCase ,   __lowerCAmelCase      )


if __name__ == "__main__":
 import doctest

 doctest.testmod()

 lowerCamelCase     :							List[str]    =input('''Enter numbers separated by a comma : ''').strip()
 lowerCamelCase     :							List[Any]    =[float(item) for item in user_input.split(''',''')]
 print(sort(unsorted))







from __future__ import annotations







def 		SCREAMING_SNAKE_CASE							( __lowerCAmelCase ,   __lowerCAmelCase      )			->     list[int]:
     UpperCamelCase__      :       Optional[Any]	    =  0
     UpperCamelCase__      :       Any	    =  len(__lowerCAmelCase      ) - 1

     while i < j:
          if nums[i] + nums[j] == target:
               return [i, j]
          elif nums[i] + nums[j] < target:
               UpperCamelCase__      :       Optional[int]	    =  i + 1
          else:
               UpperCamelCase__      :       Dict	    =  j - 1

     return []


if __name__ == "__main__":
 import doctest

 doctest.testmod()
 print(F"""{two_pointer([2, 7, 11, 15], 9) = }""")