
"""simple docstring"""


def  lowercase						(	lowerCAmelCase__	,lowerCAmelCase__						):
			return (pointa[0] - pointa[0]) ** 2 + (pointa[1] - pointa[1]) ** 2






def  lowercase						(	lowerCAmelCase__	,lowerCAmelCase__=0						):
			return sorted(lowerCAmelCase__	,key=lambda lowerCAmelCase__						: x[column]						)






def  lowercase						(	lowerCAmelCase__	,lowerCAmelCase__	,lowerCAmelCase__=float('''inf'''						)						):

			for i in range(points_counts - 1						):
						for j in range(i + 1	,lowerCAmelCase__						):
									lowerCamelCase_					=  euclidean_distance_sqr(points[i]	,points[j]						)
									if current_dis < min_dis:
												lowerCamelCase_					=  current_dis
			return min_dis






def  lowercase						(	lowerCAmelCase__	,lowerCAmelCase__	,lowerCAmelCase__=float('''inf'''						)						):

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






def  lowercase						(	lowerCAmelCase__	,lowerCAmelCase__	,lowerCAmelCase__						):

			# base case
			if points_counts <= 3:
						return dis_between_closest_pair(lowerCAmelCase__	,lowerCAmelCase__						)

			# recursion
			lowerCamelCase_					=  points_counts // 2
			lowerCamelCase_					=  closest_pair_of_points_sqr(
			    lowerCAmelCase__	,points_sorted_on_y[:mid]	,lowerCAmelCase__						)
			lowerCamelCase_					=  closest_pair_of_points_sqr(
			    lowerCAmelCase__	,points_sorted_on_y[mid:]	,points_counts - mid						)
			lowerCamelCase_					=  min(lowerCAmelCase__	,lowerCAmelCase__						)
			lowerCamelCase_					=  []
			for point in points_sorted_on_x:
						if abs(point[0] - points_sorted_on_x[mid][0]						) < closest_pair_dis:
									cross_strip.append(lowerCAmelCase__						)

			lowerCamelCase_					=  dis_between_closest_in_strip(
			    lowerCAmelCase__	,len(lowerCAmelCase__						)	,lowerCAmelCase__						)
			return min(lowerCAmelCase__	,lowerCAmelCase__						)






def  lowercase						(	lowerCAmelCase__	,lowerCAmelCase__						):
			lowerCamelCase_					=  column_based_sort(lowerCAmelCase__	,column=0						)
			lowerCamelCase_					=  column_based_sort(lowerCAmelCase__	,column=1						)
			return (
			    closest_pair_of_points_sqr(
			        lowerCAmelCase__	,lowerCAmelCase__	,lowerCAmelCase__						)
			) ** 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  lowercase						(	lowerCAmelCase__						):
			return " ".join(input_str.split()[::-1]						)


if __name__ == "__main__":
						import doctest

						doctest.testmod()



