


def 							UpperCAmelCase				(     UpperCAmelCase      )->		tuple[int, int]:







					'''simple docstring'''



					if len(UpperCAmelCase      ) == 1:
										return a[0], a[0]
					else:
										# split A into half.
										SCREAMING_SNAKE_CASE_	      =       a[: len(UpperCAmelCase      ) // 2]
										SCREAMING_SNAKE_CASE_	      =       a[len(UpperCAmelCase      ) // 2 :]

										# 2 sub problems, 1/2 of original size.
										SCREAMING_SNAKE_CASE_      ,SCREAMING_SNAKE_CASE_	      =       max_difference(UpperCAmelCase      )
										SCREAMING_SNAKE_CASE_      ,SCREAMING_SNAKE_CASE_	      =       max_difference(UpperCAmelCase      )

										# get min of first and max of second
										# linear time
										SCREAMING_SNAKE_CASE_	      =       min(UpperCAmelCase      )
										SCREAMING_SNAKE_CASE_	      =       max(UpperCAmelCase      )

										# 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()






def 							UpperCAmelCase				(     UpperCAmelCase      )->		bool:







					'''simple docstring'''



					if not isinstance(UpperCAmelCase				,UpperCAmelCase      ):
										SCREAMING_SNAKE_CASE_	      =       f'''Input value of [number={number}] must be an integer'''
										raise TypeError(UpperCAmelCase      )
					if number < 0 or number % 2 == 1:
										return False
					SCREAMING_SNAKE_CASE_	      =       int(number**0.5      )
					return number == number_sqrt * (number_sqrt + 1)


if __name__ == "__main__":
		import doctest

		doctest.testmod()


