



"""simple docstring"""

def 							SCREAMING_SNAKE_CASE__      (		SCREAMING_SNAKE_CASE__ :  Optional[Any]				,    SCREAMING_SNAKE_CASE__ :  str			):



					"""simple docstring"""





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







def 							SCREAMING_SNAKE_CASE__      (		SCREAMING_SNAKE_CASE__ :  List[str]				,    SCREAMING_SNAKE_CASE__ :  int=0			):



					"""simple docstring"""





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







def 							SCREAMING_SNAKE_CASE__      (		SCREAMING_SNAKE_CASE__ :  Union[str, Any]				,    SCREAMING_SNAKE_CASE__ :  Optional[int]				,    SCREAMING_SNAKE_CASE__ :  Any=float("""inf"""			)			):



					"""simple docstring"""





					for i in range(points_counts - 1			):
										for j in range(i + 1				,    SCREAMING_SNAKE_CASE__			):
															snake_case_					:		str 					=					euclidean_distance_sqr(points[i]				,    points[j]			)
															if current_dis < min_dis:
																				snake_case_					:		Tuple 					=					current_dis
					return min_dis







def 							SCREAMING_SNAKE_CASE__      (		SCREAMING_SNAKE_CASE__ :  Tuple				,    SCREAMING_SNAKE_CASE__ :  Union[str, Any]				,    SCREAMING_SNAKE_CASE__ :  Optional[Any]=float("""inf"""			)			):



					"""simple docstring"""





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







def 							SCREAMING_SNAKE_CASE__      (		SCREAMING_SNAKE_CASE__ :  List[Any]				,    SCREAMING_SNAKE_CASE__ :  Tuple				,    SCREAMING_SNAKE_CASE__ :  List[Any]			):



					"""simple docstring"""





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

					# recursion
					snake_case_					:		Optional[Any] 					=					points_counts // 2
					snake_case_					:		Union[str, Any] 					=					closest_pair_of_points_sqr(
					    SCREAMING_SNAKE_CASE__				,    points_sorted_on_y[:mid]				,    SCREAMING_SNAKE_CASE__			)
					snake_case_					:		Optional[int] 					=					closest_pair_of_points_sqr(
					    SCREAMING_SNAKE_CASE__				,    points_sorted_on_y[mid:]				,    points_counts - mid			)
					snake_case_					:		Optional[int] 					=					min(SCREAMING_SNAKE_CASE__				,    SCREAMING_SNAKE_CASE__			)
					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(SCREAMING_SNAKE_CASE__			)

					snake_case_					:		int 					=					dis_between_closest_in_strip(
					    SCREAMING_SNAKE_CASE__				,    len(SCREAMING_SNAKE_CASE__			)				,    SCREAMING_SNAKE_CASE__			)
					return min(SCREAMING_SNAKE_CASE__				,    SCREAMING_SNAKE_CASE__			)







def 							SCREAMING_SNAKE_CASE__      (		SCREAMING_SNAKE_CASE__ :  str				,    SCREAMING_SNAKE_CASE__ :  str			):



					"""simple docstring"""





					snake_case_					:		Tuple 					=					column_based_sort(SCREAMING_SNAKE_CASE__				,    column=0			)
					snake_case_					:		str 					=					column_based_sort(SCREAMING_SNAKE_CASE__				,    column=1			)
					return (
					    closest_pair_of_points_sqr(
					        SCREAMING_SNAKE_CASE__				,    SCREAMING_SNAKE_CASE__				,    SCREAMING_SNAKE_CASE__			)
					) ** 0.5


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









"""simple docstring"""

def 							SCREAMING_SNAKE_CASE__      (		SCREAMING_SNAKE_CASE__ :  int				,    SCREAMING_SNAKE_CASE__ :  int			):



					"""simple docstring"""





					return numa ^ numa < 0


if __name__ == "__main__":
			import doctest

			doctest.testmod()




