




'''simple docstring'''




def      a_							(      __snake_case							:			str   ,       __snake_case							:			Dict   )							->						Dict:



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





def      a_							(      __snake_case							:			Tuple   ,       __snake_case							:			Union[str, Any]=0   )							->						List[str]:



       """simple docstring"""
       return sorted(__snake_case   ,       key=lambda __snake_case   : x[column]   )





def      a_							(      __snake_case							:			Any   ,       __snake_case							:			Dict   ,       __snake_case							:			Tuple=float('''inf'''   )   )							->						Union[str, Any]:



       """simple docstring"""

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





def      a_							(      __snake_case							:			Optional[Any]   ,       __snake_case							:			Tuple   ,       __snake_case							:			Optional[int]=float('''inf'''   )   )							->						str:



       """simple docstring"""

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





def      a_							(      __snake_case							:			Any   ,       __snake_case							:			Optional[int]   ,       __snake_case							:			Dict   )							->						Optional[Any]:



       """simple docstring"""

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

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

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





def      a_							(      __snake_case							:			Union[str, Any]   ,       __snake_case							:			str   )							->						Union[str, Any]:



       """simple docstring"""
       lowerCamelCase_							=column_based_sort(__snake_case   ,       column=0   )
       lowerCamelCase_							=column_based_sort(__snake_case   ,       column=1   )
       return (
           closest_pair_of_points_sqr(
               __snake_case   ,       __snake_case   ,       __snake_case   )
       ) ** 0.5


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








'''simple docstring'''



A__		:					Any												=  8.3_1_4_4_6_2  # Unit - J mol-1 K-1



def 			UpperCAmelCase__					(	UpperCAmelCase_    :				float      ,    UpperCAmelCase_    :				float      ,    UpperCAmelCase_    :				float							)     ->		float:
     if moles < 0 or kelvin < 0 or volume < 0:
          raise ValueError('Invalid inputs. Enter positive value.'							)
     return moles * kelvin * UNIVERSAL_GAS_CONSTANT / volume



def 			UpperCAmelCase__					(	UpperCAmelCase_    :				float      ,    UpperCAmelCase_    :				float      ,    UpperCAmelCase_    :				float							)     ->		float:
     if moles < 0 or kelvin < 0 or pressure < 0:
          raise ValueError('Invalid inputs. Enter positive value.'							)
     return moles * kelvin * UNIVERSAL_GAS_CONSTANT / pressure


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

      testmod()






