





def    _A	(   lowerCamelCase				,			lowerCamelCase ):
   return (pointa[0] - pointa[0]) ** 2 + (pointa[1] - pointa[1]) ** 2






def    _A	(   lowerCamelCase				,			lowerCamelCase=0 ):
   return sorted(lowerCamelCase				,			key=lambda lowerCamelCase : x[column] )






def    _A	(   lowerCamelCase				,			lowerCamelCase				,			lowerCamelCase=float("inf" ) ):

   for i in range(points_counts - 1 ):
      for j in range(i + 1				,			lowerCamelCase ):
         a__						:    int   		=	euclidean_distance_sqr(points[i]				,			points[j] )
         if current_dis < min_dis:
            a__						:    List[Any]   		=	current_dis
   return min_dis






def    _A	(   lowerCamelCase				,			lowerCamelCase				,			lowerCamelCase=float("inf" ) ):

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






def    _A	(   lowerCamelCase				,			lowerCamelCase				,			lowerCamelCase ):

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

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

   a__						:    Any   		=	dis_between_closest_in_strip(
       lowerCamelCase				,			len(lowerCamelCase )				,			lowerCamelCase )
   return min(lowerCamelCase				,			lowerCamelCase )






def    _A	(   lowerCamelCase				,			lowerCamelCase ):
   a__						:    Dict   		=	column_based_sort(lowerCamelCase				,			column=0 )
   a__						:    Dict   		=	column_based_sort(lowerCamelCase				,			column=1 )
   return (
       closest_pair_of_points_sqr(
           lowerCamelCase				,			lowerCamelCase				,			lowerCamelCase )
   ) ** 0.5


if __name__ == "__main__":
  SCREAMING_SNAKE_CASE__							:      Union[str, Any]         =    [(2, 3), (1_2, 3_0), (4_0, 5_0), (5, 1), (1_2, 1_0), (3, 4)]
  print("""Distance:""", closest_pair_of_points(points, len(points)))








from packaging import version

from .import_utils import is_accelerate_available


if is_accelerate_available():
  import accelerate






def    _A	(   lowerCamelCase ):
   if not is_accelerate_available():
      return method
   a__						:    List[Any]   		=	version.parse(accelerate.__version__ ).base_version
   if version.parse(lowerCamelCase ) < version.parse("0.17.0" ):
      return method

   def wrapper(self				,			*lowerCamelCase				,			**lowerCamelCase ):
      if hasattr(self				,			"_hf_hook" ) and hasattr(self._hf_hook				,			"pre_forward" ):
         self._hf_hook.pre_forward(self )
      return method(self				,			*lowerCamelCase				,			**lowerCamelCase )

   return wrapper

