




"""simple docstring"""







from __future__ import annotations





def 							lowercase    (snake_case__      :       list					,				snake_case__      :       int					,				snake_case__      :       int					,				snake_case__      :       int       )   ->     Tuple:


				'''simple docstring'''






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





def 							lowercase    (snake_case__      :       list       )   ->     Any:


				'''simple docstring'''






				if len(snake_case__       ) <= 1:
								return input_list
				lowerCAmelCase              = list(snake_case__       )

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

				return input_list


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







def 				a						(							snake_case__:					list						,   snake_case__:					list						,   snake_case__:					int						,   snake_case__:					int						,   snake_case__:					int					):


				'''simple docstring'''
				if index == number_of_items:
								return 0
				lowercase_       =					0
				lowercase_       =					0
				lowercase_       =					knapsack(snake_case__						,   snake_case__						,   snake_case__						,   snake_case__						,   index + 1					)
				if weights[index] <= max_weight:
								lowercase_       =					values[index] + knapsack(
								    snake_case__						,   snake_case__						,   snake_case__						,   max_weight - weights[index]						,   index + 1					)
				return max(snake_case__						,   snake_case__					)


if __name__ == "__main__":
						import doctest

						doctest.testmod()




