





def  UpperCamelCase__     (   _A:    Tuple							,    _A:    str				):




      '''simple docstring'''







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



def  UpperCamelCase__     (   _A:    int							,    _A:    int=0				):




      '''simple docstring'''







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



def  UpperCamelCase__     (   _A:    List[Any]							,    _A:    int							,    _A:    Tuple=float("""inf"""				)				):




      '''simple docstring'''







      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  UpperCamelCase__     (   _A:    Optional[int]							,    _A:    List[Any]							,    _A:    Union[str, Any]=float("""inf"""				)				):




      '''simple docstring'''







      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  UpperCamelCase__     (   _A:    int							,    _A:    int							,    _A:    int				):




      '''simple docstring'''







      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  UpperCamelCase__     (   _A:    Dict							,    _A:    Optional[Any]				):




      '''simple docstring'''







      __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				:	List[Any]           =       [(2, 3), (12, 30), (40, 50), (5, 1), (12, 10), (3, 4)]
   print('Distance:', closest_pair_of_points(points, len(points)))












from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tokenizers_available, is_torch_available


__magic_name__  :  List[str]					=       {
    """configuration_m2m_100""": ["""M2M_100_PRETRAINED_CONFIG_ARCHIVE_MAP""", """M2M100Config""", """M2M100OnnxConfig"""],
    """tokenization_m2m_100""": ["""M2M100Tokenizer"""],
}


try:
      if not is_torch_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      __magic_name__  :  Union[str, Any]					=       [
          """M2M_100_PRETRAINED_MODEL_ARCHIVE_LIST""",
          """M2M100ForConditionalGeneration""",
          """M2M100Model""",
          """M2M100PreTrainedModel""",
      ]


if TYPE_CHECKING:
      from .configuration_mam_aaa import M2M_100_PRETRAINED_CONFIG_ARCHIVE_MAP, MaMaaaConfig, MaMaaaOnnxConfig
      from .tokenization_mam_aaa import MaMaaaTokenizer

      try:
            if not is_torch_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .modeling_mam_aaa import (
                M2M_100_PRETRAINED_MODEL_ARCHIVE_LIST,
                MaMaaaForConditionalGeneration,
                MaMaaaModel,
                MaMaaaPreTrainedModel,
            )


else:
      import sys

      __magic_name__  :  List[str]					=       _LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)

