



from __future__ import annotations





def 	__snake_case      (     _UpperCAmelCase  ,					_UpperCAmelCase							):
    __a					=							0
    __a					=							len(_UpperCAmelCase							) - 1
    while left <= right:
        __a					=							(left + right) // 2
        if left == right:
            if sorted_list[middle] < item:
                __a					=							middle + 1
            break
        elif sorted_list[middle] < item:
            __a					=							middle + 1
        else:
            __a					=							middle - 1
    sorted_list.insert(_UpperCAmelCase  ,					_UpperCAmelCase							)
    return sorted_list





def 	__snake_case      (     _UpperCAmelCase  ,					_UpperCAmelCase							):
    __a					=							[]
    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 	__snake_case      (     _UpperCAmelCase							):
    __a					=							len(_UpperCAmelCase							)
    if length <= 1:
        return list_ad
    __a					=							length // 2
    return merge(sortlist_ad(list_ad[:middle]							)  ,					sortlist_ad(list_ad[middle:]							)							)





def 	__snake_case      (     _UpperCAmelCase							):

    if len(_UpperCAmelCase							) <= 1:
        return collection
    __a					=							[]
    __a					=							False
    for i in range(0  ,					len(_UpperCAmelCase							)  ,					2							):
        if i == len(_UpperCAmelCase							) - 1:
            __a					=							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]]							)
    __a					=							sortlist_ad(_UpperCAmelCase							)
    __a					=							[i[0] for i in sorted_list_ad]
    result.append(sorted_list_ad[-1][1]							)
    if has_last_odd_item:
        __a					=							collection[-1]
        __a					=							binary_search_insertion(_UpperCAmelCase  ,					_UpperCAmelCase							)
    __a					=							False
    for i in range(len(_UpperCAmelCase							) - 1							):
        if result[i] == collection[-1] and has_last_odd_item:
            __a					=							True
        __a					=							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:
            __a					=							result[: i + 2] + binary_search_insertion(result[i + 2 :]  ,					_UpperCAmelCase							)
        else:
            __a					=							result[: i + 1] + binary_search_insertion(result[i + 1 :]  ,					_UpperCAmelCase							)

    return result


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










def 	__snake_case      (     _UpperCAmelCase  ,					_UpperCAmelCase  ,					_UpperCAmelCase							):
    __a					=							[1 / first_term]
    __a					=							1 / first_term
    for _ in range(number_of_terms - 1							):
        first_term += common_difference
        arithmetic_progression.append(_UpperCAmelCase							)
    __a					=							[1 / step for step in arithmetic_progression]
    return sum(_UpperCAmelCase							)


if __name__ == "__main__":
 import doctest

 doctest.testmod()
 print(sum_of_harmonic_progression(1 / 2, 2, 2))





