

from __future__ import annotations



def      snake_case__      (   SCREAMING_SNAKE_CASE_		:   Any     ,					SCREAMING_SNAKE_CASE_		:   Any     ,					SCREAMING_SNAKE_CASE_		:   Optional[Any]     ,					SCREAMING_SNAKE_CASE_		:   List[Any]      ):



     '''simple docstring'''





     lowercase__   :       List[str]				=	[]
     lowercase__   :       List[str]				=	input_list[low:mid], input_list[mid : high + 1]
     while left and right:
          result.append((left if left[0] <= right[0] else right).pop(0      )      )
     lowercase__   :       List[Any]				=	result + left + right
     return input_list



def      snake_case__      (   SCREAMING_SNAKE_CASE_		:   int      ):



     '''simple docstring'''





     if len(__lowerCAmelCase      ) <= 1:
          return input_list
     lowercase__   :       Tuple				=	list(__lowerCAmelCase      )

     # iteration for two-way merging
     lowercase__   :       Optional[Any]				=	2
     while p <= len(__lowerCAmelCase      ):
          # getting low, high and middle value for merge-sort of single list
          for i in range(0     ,					len(__lowerCAmelCase      )     ,					__lowerCAmelCase      ):
               lowercase__   :       Dict				=	i
               lowercase__   :       Tuple				=	i + p - 1
               lowercase__   :       str				=	(low + high + 1) // 2
               lowercase__   :       List[str]				=	merge(__lowerCAmelCase     ,					__lowerCAmelCase     ,					__lowerCAmelCase     ,					__lowerCAmelCase      )
          # final merge of last two parts
          if p * 2 >= len(__lowerCAmelCase      ):
               lowercase__   :       List[str]				=	i
               lowercase__   :       Any				=	merge(__lowerCAmelCase     ,					0     ,					__lowerCAmelCase     ,					len(__lowerCAmelCase      ) - 1      )
               break
          p *= 2

     return input_list


if __name__ == "__main__":
       snake_case_        =			input('''Enter numbers separated by a comma:\n''').strip()
       if user_input == "":
              snake_case_        =			[]
       else:
              snake_case_        =			[int(item.strip()) for item in user_input.split(''',''')]
       print(iter_merge_sort(unsorted))




import numpy as np

def      snake_case__      (   SCREAMING_SNAKE_CASE_		:   str     ,					SCREAMING_SNAKE_CASE_		:   Optional[int]     ,					SCREAMING_SNAKE_CASE_		:   Optional[int]     ,					SCREAMING_SNAKE_CASE_		:   Union[str, Any]     ,					SCREAMING_SNAKE_CASE_		:   List[Any]      ):



     '''simple docstring'''





     lowercase__   :       List[Any]				=	int(np.ceil((x_end - xa) / h      )      )
     lowercase__   :       Dict				=	np.zeros((n + 1,)      )
     lowercase__   :       Dict				=	ya
     lowercase__   :       Union[str, Any]				=	xa

     for k in range(SCREAMING_SNAKE_CASE_      ):
          lowercase__   :       Optional[int]				=	f(SCREAMING_SNAKE_CASE_     ,					y[k]      )
          lowercase__   :       Dict				=	f(x + 0.5 * h     ,					y[k] + 0.5 * h * ka      )
          lowercase__   :       Any				=	f(x + 0.5 * h     ,					y[k] + 0.5 * h * ka      )
          lowercase__   :       List[Any]				=	f(x + h     ,					y[k] + h * ka      )
          lowercase__   :       Tuple				=	y[k] + (1 / 6) * h * (ka + 2 * ka + 2 * ka + ka)
          x += h

     return y


if __name__ == "__main__":
       import doctest

       doctest.testmod()

