





'''simple docstring'''


from __future__ import annotations




def       A							(      _UpperCAmelCase   :				Union[str, Any]						,_UpperCAmelCase   :				Tuple					)  ->				Union[str, Any]:


  '''simple docstring'''




  __lowerCAmelCase		:    Optional[int]			     =  0
  __lowerCAmelCase		:    int			     =  len(_UpperCAmelCase					) - 1
  while left <= right:
    __lowerCAmelCase		:    List[Any]			     =  (left + right) // 2
    if left == right:
      if sorted_list[middle] < item:
        __lowerCAmelCase		:    str			     =  middle + 1
      break
    elif sorted_list[middle] < item:
      __lowerCAmelCase		:    Union[str, Any]			     =  middle + 1
    else:
      __lowerCAmelCase		:    List[str]			     =  middle - 1
  sorted_list.insert(_UpperCAmelCase						,_UpperCAmelCase					)
  return sorted_list




def       A							(      _UpperCAmelCase   :				List[str]						,_UpperCAmelCase   :				int					)  ->				Union[str, Any]:


  '''simple docstring'''




  __lowerCAmelCase		:    int			     =  []
  while left and right:
    if left[0][0] < right[0][0]:
      result.append(left.pop(0					)					)
    else:
      result.append(right.pop(0					)					)
  return result + left + right




def       A							(      _UpperCAmelCase   :				int					)  ->				str:


  '''simple docstring'''




  __lowerCAmelCase		:    List[str]			     =  len(_UpperCAmelCase					)
  if length <= 1:
    return list_ad
  __lowerCAmelCase		:    Dict			     =  length // 2
  return merge(sortlist_ad(list_ad[:middle]					)						,sortlist_ad(list_ad[middle:]					)					)




def       A							(      _UpperCAmelCase   :				list[int]					)  ->				list[int]:


  '''simple docstring'''




  if len(_UpperCAmelCase					) <= 1:
    return collection
  __lowerCAmelCase		:    Tuple			     =  []
  __lowerCAmelCase		:    Tuple			     =  False
  for i in range(0						,len(_UpperCAmelCase					)						,2					):
    if i == len(_UpperCAmelCase					) - 1:
      __lowerCAmelCase		:    List[str]			     =  True
    else:
      if collection[i] < collection[i + 1]:
        two_paired_list.append([collection[i], collection[i + 1]]					)
      else:
        two_paired_list.append([collection[i + 1], collection[i]]					)
  __lowerCAmelCase		:    Tuple			     =  sortlist_ad(_UpperCAmelCase					)
  __lowerCAmelCase		:    Dict			     =  [i[0] for i in sorted_list_ad]
  result.append(sorted_list_ad[-1][1]					)
  if has_last_odd_item:
    __lowerCAmelCase		:    Any			     =  collection[-1]
    __lowerCAmelCase		:    Optional[int]			     =  binary_search_insertion(_UpperCAmelCase						,_UpperCAmelCase					)
  __lowerCAmelCase		:    List[Any]			     =  False
  for i in range(len(_UpperCAmelCase					) - 1					):
    if result[i] == collection[-1] and has_last_odd_item:
      __lowerCAmelCase		:    Optional[int]			     =  True
    __lowerCAmelCase		:    int			     =  sorted_list_ad[i][1]
    # If last_odd_item is inserted before the item's index,
    # you should forward index one more.
    if is_last_odd_item_inserted_before_this_index:
      __lowerCAmelCase		:    Union[str, Any]			     =  result[: i + 2] + binary_search_insertion(result[i + 2 :]						,_UpperCAmelCase					)
    else:
      __lowerCAmelCase		:    int			     =  result[: i + 1] + binary_search_insertion(result[i + 1 :]						,_UpperCAmelCase					)

  return result


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












'''simple docstring'''


from __future__ import annotations

from collections.abc import Callable




def       A							(      _UpperCAmelCase   :				Callable[[int | float], int | float]						,_UpperCAmelCase   :				int | float						,_UpperCAmelCase   :				int | float						,_UpperCAmelCase   :				int = 1_0_0						,)  ->				float:


  '''simple docstring'''




  __lowerCAmelCase		:    Dict			     =  x_start
  __lowerCAmelCase		:    Tuple			     =  fnc(_UpperCAmelCase					)
  __lowerCAmelCase		:    Optional[int]			     =  0.0

  for _ in range(_UpperCAmelCase					):
    # Approximates small segments of curve as linear and solve
    # for trapezoidal area
    __lowerCAmelCase		:    Optional[int]			     =  (x_end - x_start) / steps + xa
    __lowerCAmelCase		:    Optional[Any]			     =  fnc(_UpperCAmelCase					)
    area += abs(fxa + fxa					) * (xa - xa) / 2

    # Increment step
    __lowerCAmelCase		:    Optional[Any]			     =  xa
    __lowerCAmelCase		:    List[Any]			     =  fxa
  return area


if __name__ == "__main__":




    def       A							(      _UpperCAmelCase   :				List[Any]					)  ->				List[Any]:


      '''simple docstring'''




      return x**3

    print("f(x) = x^3")
    print("The area between the curve, x = -10, x = 10 and the x axis is:")
    A_				     =							10
    while i <= 10_00_00:
        A_				     =							trapezoidal_area(f, -5, 5, i)
        print(F'''with {i} steps: {area}''')
        i *= 10





