



'''simple docstring'''

def   __lowerCamelCase  (   lowerCAmelCase_						)    ->   list:
		_a  :   Any				 =							len(lowerCAmelCase_						)

		# Set the gap value to be decreased by a factor of 1.3
		# after each iteration
		_a  :   Tuple				 =							1.3

		# Continue sorting until the gap is 1
		while gap > 1:
				# Decrease the gap value
				_a  :   Any				 =							int(gap / shrink						)

				# Sort the elements using insertion sort
				for i in range(lowerCAmelCase_		,    len(lowerCAmelCase_						)						):
						_a  :   Optional[int]				 =							collection[i]
						_a  :   Optional[int]				 =							i
						while j >= gap and collection[j - gap] > temp:
								_a  :   int				 =							collection[j - gap]
								j -= gap
						_a  :   Union[str, Any]				 =							temp

		return collection


if __name__ == "__main__":
							import doctest

							doctest.testmod()









'''simple docstring'''

def   __lowerCamelCase  (   lowerCAmelCase_						)    ->   tuple[int, int]:
		# base case
		if len(lowerCAmelCase_						) == 1:
				return a[0], a[0]
		else:
				# split A into half.
				_a  :   Union[str, Any]				 =							a[: len(lowerCAmelCase_						) // 2]
				_a  :   List[Any]				 =							a[len(lowerCAmelCase_						) // 2 :]

				# 2 sub problems, 1/2 of original size.
				_a ,      _a  :   Any				 =							max_difference(lowerCAmelCase_						)
				_a ,      _a  :   Any				 =							max_difference(lowerCAmelCase_						)

				# get min of first and max of second
				# linear time
				_a  :   Union[str, Any]				 =							min(lowerCAmelCase_						)
				_a  :   Optional[int]				 =							max(lowerCAmelCase_						)

				# 3 cases, either (small1, big1),
				# (min_first, max_second), (small2, big2)
				# constant comparisons
				if biga - smalla > max_second - min_first and biga - smalla > biga - smalla:
						return smalla, biga
				elif biga - smalla > max_second - min_first:
						return smalla, biga
				else:
						return min_first, max_second


if __name__ == "__main__":
							import doctest

							doctest.testmod()




