





def        UpperCAmelCase_     (		_A   ,	_A       ):





     '''simple docstring'''




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





     '''simple docstring'''




     return sorted(__A   ,	key=lambda _A       : x[column]       )
def        UpperCAmelCase_     (		_A   ,	_A   ,	_A=float('''inf'''       )       ):





     '''simple docstring'''




     for i in range(points_counts - 1       ):
          for j in range(i + 1   ,	__A       ):
               SCREAMING_SNAKE_CASE__					=					euclidean_distance_sqr(points[i]   ,	points[j]       )
               if current_dis < min_dis:
                    SCREAMING_SNAKE_CASE__					=					current_dis
     return min_dis
def        UpperCAmelCase_     (		_A   ,	_A   ,	_A=float('''inf'''       )       ):





     '''simple docstring'''




     for i in range(min(6   ,	points_counts - 1       )   ,	__A       ):
          for j in range(max(0   ,	i - 6       )   ,	__A       ):
               SCREAMING_SNAKE_CASE__					=					euclidean_distance_sqr(points[i]   ,	points[j]       )
               if current_dis < min_dis:
                    SCREAMING_SNAKE_CASE__					=					current_dis
     return min_dis
def        UpperCAmelCase_     (		_A   ,	_A   ,	_A       ):





     '''simple docstring'''




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

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

     SCREAMING_SNAKE_CASE__					=					dis_between_closest_in_strip(
         __A   ,	len(__A       )   ,	__A       )
     return min(__A   ,	__A       )
def        UpperCAmelCase_     (		_A   ,	_A       ):





     '''simple docstring'''




     SCREAMING_SNAKE_CASE__					=					column_based_sort(__A   ,	column=0       )
     SCREAMING_SNAKE_CASE__					=					column_based_sort(__A   ,	column=1       )
     return (
         closest_pair_of_points_sqr(
             __A   ,	__A   ,	__A       )
     ) ** 0.5


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





from collections.abc import Callable

import numpy as np
def        UpperCAmelCase_     (		_A   ,	_A   ,	_A   ,	_A   ,	_A       ):





     '''simple docstring'''




     SCREAMING_SNAKE_CASE__					=					int(np.ceil((x_end - xa) / step_size       )       )
     SCREAMING_SNAKE_CASE__					=					np.zeros((n + 1,)       )
     SCREAMING_SNAKE_CASE__					=					ya
     SCREAMING_SNAKE_CASE__					=					xa

     for k in range(_A       ):
          SCREAMING_SNAKE_CASE__					=					y[k] + step_size * ode_func(_A   ,	y[k]       )
          SCREAMING_SNAKE_CASE__					=					y[k] + (
              (step_size / 2) * (ode_func(_A   ,	y[k]       ) + ode_func(x + step_size   ,	_A       ))
          )
          x += step_size

     return y


if __name__ == "__main__":
       import doctest

       doctest.testmod()


