




'''simple docstring'''





def       lowerCAmelCase_     (					__A						:							Any ,			__A						:							Tuple ):




			'''simple docstring'''


			return (pointa[0] - pointa[0]) ** 2 + (pointa[1] - pointa[1]) ** 2





def       lowerCAmelCase_     (					__A						:							Tuple ,			__A						:							Optional[int]=0 ):




			'''simple docstring'''


			return sorted(_lowercase ,			key=lambda __A : x[column] )





def       lowerCAmelCase_     (					__A						:							str ,			__A						:							Dict ,			__A						:							Dict=float('inf' ) ):




			'''simple docstring'''


			for i in range(points_counts - 1 ):
						for j in range(i + 1 ,			_lowercase ):
									snake_case:       Union[str, Any]        =       euclidean_distance_sqr(points[i] ,			points[j] )
									if current_dis < min_dis:
												snake_case:       Dict        =       current_dis
			return min_dis





def       lowerCAmelCase_     (					__A						:							List[str] ,			__A						:							Tuple ,			__A						:							Optional[Any]=float('inf' ) ):




			'''simple docstring'''


			for i in range(min(6 ,			points_counts - 1 ) ,			_lowercase ):
						for j in range(max(0 ,			i - 6 ) ,			_lowercase ):
									snake_case:       str        =       euclidean_distance_sqr(points[i] ,			points[j] )
									if current_dis < min_dis:
												snake_case:       Any        =       current_dis
			return min_dis





def       lowerCAmelCase_     (					__A						:							Dict ,			__A						:							Optional[Any] ,			__A						:							Tuple ):




			'''simple docstring'''


			if points_counts <= 3:
						return dis_between_closest_pair(_lowercase ,			_lowercase )

			# recursion
			snake_case:       Any        =       points_counts // 2
			snake_case:       Dict        =       closest_pair_of_points_sqr(
			    _lowercase ,			points_sorted_on_y[:mid] ,			_lowercase )
			snake_case:       Dict        =       closest_pair_of_points_sqr(
			    _lowercase ,			points_sorted_on_y[mid:] ,			points_counts - mid )
			snake_case:       List[str]        =       min(_lowercase ,			_lowercase )
			snake_case:       Dict        =       []
			for point in points_sorted_on_x:
						if abs(point[0] - points_sorted_on_x[mid][0] ) < closest_pair_dis:
									cross_strip.append(_lowercase )

			snake_case:       List[Any]        =       dis_between_closest_in_strip(
			    _lowercase ,			len(_lowercase ) ,			_lowercase )
			return min(_lowercase ,			_lowercase )





def       lowerCAmelCase_     (					__A						:							Optional[int] ,			__A						:							Optional[Any] ):




			'''simple docstring'''


			snake_case:       Tuple        =       column_based_sort(_lowercase ,			column=0 )
			snake_case:       Union[str, Any]        =       column_based_sort(_lowercase ,			column=1 )
			return (
			    closest_pair_of_points_sqr(
			        _lowercase ,			_lowercase ,			_lowercase )
			) ** 0.5


if __name__ == "__main__":
			__UpperCAmelCase       =		[(2, 3), (12, 30), (40, 50), (5, 1), (12, 10), (3, 4)]
			print("Distance:", closest_pair_of_points(points, len(points)))



def 		_A		(		_lowercase )					-> int:


     """simple docstring"""


     assert column_title.isupper()
     __UpperCamelCase =			0
     __UpperCamelCase =			len(_lowercase ) - 1
     __UpperCamelCase =			0

     while index >= 0:
          __UpperCamelCase =			(ord(column_title[index] ) - 64) * pow(26					,  _lowercase )
          answer += value
          power += 1
          index -= 1

     return answer


if __name__ == "__main__":
    from doctest import testmod

    testmod()


