






"""simple docstring"""


from __future__ import annotations



def 					lowerCAmelCase				(    __UpperCamelCase		,       __UpperCamelCase		,       __UpperCamelCase		,       __UpperCamelCase ):




  """simple docstring"""







  __A									= []
  __A			,    __A									= 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 ) )
  __A									= result + left + right
  return input_list



def 					lowerCAmelCase				(    __UpperCamelCase ):




  """simple docstring"""







  if len(__UpperCamelCase ) <= 1:
    return input_list
  __A									= list(__UpperCamelCase )

  # iteration for two-way merging
  __A									= 2
  while p <= len(__UpperCamelCase ):
    # getting low, high and middle value for merge-sort of single list
    for i in range(0		,       len(__UpperCamelCase )		,       __UpperCamelCase ):
      __A									= i
      __A									= i + p - 1
      __A									= (low + high + 1) // 2
      __A									= merge(__UpperCamelCase		,       __UpperCamelCase		,       __UpperCamelCase		,       __UpperCamelCase )
    # final merge of last two parts
    if p * 2 >= len(__UpperCamelCase ):
      __A									= i
      __A									= merge(__UpperCamelCase		,       0		,       __UpperCamelCase		,       len(__UpperCamelCase ) - 1 )
      break
    p *= 2

  return input_list


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












"""simple docstring"""


class 					snake_case		:


   '''simple docstring'''

   def __init__(	self :     List[str],       _lowerCamelCase :     list[int]  ):

     '''simple docstring'''
     __A									= len(_lowerCamelCase  )
     __A									= [0] * len_array

     if len_array > 0:
       __A									= array[0]

     for i in range(1,       _lowerCamelCase  ):
       __A									= self.prefix_sum[i - 1] + array[i]


   def 				_SCREAMING_SNAKE_CASE				(	self :     List[Any],       _lowerCamelCase :     int,       _lowerCamelCase :     int  ):

     '''simple docstring'''
     if start == 0:
       return self.prefix_sum[end]

     return self.prefix_sum[end] - self.prefix_sum[start - 1]






   def 				_SCREAMING_SNAKE_CASE				(	self :     List[str],       _lowerCamelCase :     int  ):

     '''simple docstring'''
     __A									= {0}
     for sum_item in self.prefix_sum:
       if sum_item - target_sum in sums:
         return True

       sums.add(_lowerCamelCase  )

     return False


if __name__ == "__main__":
       import doctest

       doctest.testmod()




