

def  __lowerCAmelCase (  A    ,       A      ):
	print("\nVertex Distance"      )
	for i in range(UpperCamelCase_      ):
		if dist[i] != float("inf"      ):
			print(UpperCamelCase_    ,       "\t"    ,       int(dist[i]      )    ,       end="\t"      )
		else:
			print(UpperCamelCase_    ,       "\t"    ,       "INF"    ,       end="\t"      )
		print()



def  __lowerCAmelCase (  A    ,       A    ,       A      ):
	UpperCAmelCase_    			=     float("inf"      )
	UpperCAmelCase_    			=     -1
	for i in range(UpperCamelCase_      ):
		if (not vset[i]) and mdist[i] < min_val:
			UpperCAmelCase_    			=     i
			UpperCAmelCase_    			=     mdist[i]
	return min_ind



def  __lowerCAmelCase (  A    ,       A    ,       A      ):
	UpperCAmelCase_    			=     [float("inf"      ) for _ in range(UpperCamelCase_      )]
	UpperCAmelCase_    			=     [False for _ in range(UpperCamelCase_      )]
	UpperCAmelCase_    			=     0.0

	for _ in range(v - 1      ):
		UpperCAmelCase_    			=     min_dist(UpperCamelCase_    ,       UpperCamelCase_    ,       UpperCamelCase_      )
		UpperCAmelCase_    			=     True

		for i in range(UpperCamelCase_      ):
			if (
			    (not vset[i])
			    and graph[u][i] != float("inf"      )
			    and mdist[u] + graph[u][i] < mdist[i]
			):
				UpperCAmelCase_    			=     mdist[u] + graph[u][i]

	print_dist(UpperCamelCase_    ,       UpperCamelCase_      )


if __name__ == "__main__":
				_a:      Optional[Any]								=     int(input("""Enter number of vertices: """).strip())
				_a:      Dict								=     int(input("""Enter number of edges: """).strip())

				_a:      List[Any]								=     [[float("""inf""") for i in range(V)] for j in range(V)]

				for i in range(V):
								_a:      Optional[Any]								=     0.0

				for i in range(E):
								print("""\nEdge """, i + 1)
								_a:      Dict								=     int(input("""Enter source:""").strip())
								_a:      Union[str, Any]								=     int(input("""Enter destination:""").strip())
								_a:      Optional[Any]								=     float(input("""Enter weight:""").strip())
								_a:      str								=     weight

				_a:      List[str]								=     int(input("""\nEnter shortest path source:""").strip())
				dijkstra(graph, V, gsrc)


def  __lowerCAmelCase (  A      ):
	UpperCAmelCase_    			=     len(A      )

	# Set the gap value to be decreased by a factor of 1.3
	# after each iteration
	UpperCAmelCase_    			=     1.3

	# Continue sorting until the gap is 1
	while gap > 1:
		# Decrease the gap value
		UpperCAmelCase_    			=     int(gap / shrink      )

		# Sort the elements using insertion sort
		for i in range(A    ,       len(A      )      ):
			UpperCAmelCase_    			=     collection[i]
			UpperCAmelCase_    			=     i
			while j >= gap and collection[j - gap] > temp:
				UpperCAmelCase_    			=     collection[j - gap]
				j -= gap
			UpperCAmelCase_    			=     temp

	return collection


if __name__ == "__main__":
				import doctest

				doctest.testmod()