




'''simple docstring'''


def 		snake_case_   (UpperCamelCase	:  Optional[int]			,						UpperCamelCase	:  Tuple				):





							'''simple docstring'''


							print('''\nThe shortest path matrix using Floyd Warshall algorithm\n'''				)
							for i in range(UpperCamelCase				):
														for j in range(UpperCamelCase				):
																					if dist[i][j] != float('''inf'''				):
																												print(int(dist[i][j]				)			,						end='''\t'''				)
																					else:
																												print('''INF'''			,						end='''\t'''				)
														print()
def 		snake_case_   (UpperCamelCase	:  Tuple			,						UpperCamelCase	:  str				):





							'''simple docstring'''


							_a     					=    [[float('''inf'''				) for _ in range(UpperCamelCase				)] for _ in range(UpperCamelCase				)]

							for i in range(UpperCamelCase				):
														for j in range(UpperCamelCase				):
																					_a     					=    graph[i][j]

																					# check vertex k against all other vertices (i, j)
							for k in range(UpperCamelCase				):
														# looping through rows of graph array
														for i in range(UpperCamelCase				):
																					# looping through columns of graph array
																					for j in range(UpperCamelCase				):
																												if (
																												    dist[i][k] != float('''inf'''				)
																												    and dist[k][j] != float('''inf'''				)
																												    and dist[i][k] + dist[k][j] < dist[i][j]
																												):
																																			_a     					=    dist[i][k] + dist[k][j]

							_print_dist(UpperCamelCase			,						UpperCamelCase				)
							return dist, v


if __name__ == "__main__":
				_snake_case				:				Dict       							=		int(input('Enter number of vertices: '))
				_snake_case				:				List[str]       							=		int(input('Enter number of edges: '))

				_snake_case				:				str       							=		[[float('inf') for i in range(v)] for j in range(v)]

				for i in range(v):
								_snake_case				:				Optional[Any]       							=		0.0

								# src and dst are indices that must be within the array size graph[e][v]
								# failure to follow this will result in an error
				for i in range(e):
								print('\nEdge ', i + 1)
								_snake_case				:				Optional[Any]       							=		int(input('Enter source:'))
								_snake_case				:				str       							=		int(input('Enter destination:'))
								_snake_case				:				Any       							=		float(input('Enter weight:'))
								_snake_case				:				List[Any]       							=		weight

				floyd_warshall(graph, v)

				# Example Input
				# Enter number of vertices: 3
				# Enter number of edges: 2

				# # generated graph from vertex and edge inputs
				# [[inf, inf, inf], [inf, inf, inf], [inf, inf, inf]]
				# [[0.0, inf, inf], [inf, 0.0, inf], [inf, inf, 0.0]]

				# specify source, destination and weight for edge #1
				# Edge  1
				# Enter source:1
				# Enter destination:2
				# Enter weight:2

				# specify source, destination and weight for edge #2
				# Edge  2
				# Enter source:2
				# Enter destination:1
				# Enter weight:1

				# # Expected Output from the vertice, edge and src, dst, weight inputs!!
				# 0		INF	INF
				# INF	0	2
				# INF	1	0







'''simple docstring'''


def 		snake_case_   (UpperCamelCase	:  str			,						UpperCamelCase	:  Any				):





							'''simple docstring'''


							return (pointa[0] - pointa[0]) ** 2 + (pointa[1] - pointa[1]) ** 2
def 		snake_case_   (UpperCamelCase	:  Any			,						UpperCamelCase	:  str=0				):





							'''simple docstring'''


							return sorted(UpperCamelCase			,						key=lambda UpperCamelCase				: x[column]				)
def 		snake_case_   (UpperCamelCase	:  Optional[int]			,						UpperCamelCase	:  Any			,						UpperCamelCase	:  Union[str, Any]=float('''inf'''				)				):





							'''simple docstring'''


							for i in range(points_counts - 1				):
														for j in range(i + 1			,						UpperCamelCase				):
																					_a     					=    euclidean_distance_sqr(points[i]			,						points[j]				)
																					if current_dis < min_dis:
																												_a     					=    current_dis
							return min_dis
def 		snake_case_   (UpperCamelCase	:  int			,						UpperCamelCase	:  Tuple			,						UpperCamelCase	:  List[str]=float('''inf'''				)				):





							'''simple docstring'''


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





							'''simple docstring'''


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

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

							_a     					=    dis_between_closest_in_strip(
							    UpperCamelCase			,						len(UpperCamelCase				)			,						UpperCamelCase				)
							return min(UpperCamelCase			,						UpperCamelCase				)
def 		snake_case_   (UpperCamelCase	:  Optional[int]			,						UpperCamelCase	:  List[str]				):





							'''simple docstring'''


							_a     					=    column_based_sort(UpperCamelCase			,						column=0				)
							_a     					=    column_based_sort(UpperCamelCase			,						column=1				)
							return (
							    closest_pair_of_points_sqr(
							        UpperCamelCase			,						UpperCamelCase			,						UpperCamelCase				)
							) ** 0.5


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

