'''simple docstring'''







from __future__ import annotations


def    lowerCamelCase       (			UpperCAmelCase__				:  list[float]				,						UpperCAmelCase__				:  Any		)			->	Any:


							'''simple docstring'''






							print(F'''Vertex\tShortest Distance from vertex {src}'''		)
							for i, d in enumerate(__lowercase		):
														print(F'''{i}\t\t{d}'''		)


def    lowerCamelCase       (			UpperCAmelCase__				:  list[dict[str, int]]				,						UpperCAmelCase__				:  list[float]				,						UpperCAmelCase__				:  int		)			->	Any:


							'''simple docstring'''






							for j in range(__lowercase		):
														SCREAMING_SNAKE_CASE__    ,      SCREAMING_SNAKE_CASE__    ,      SCREAMING_SNAKE_CASE__     :Union[str, Any]						    = (graph[j][k] for k in ['src', 'dst', 'weight'])
														if distance[u] != float('inf'		) and distance[u] + w < distance[v]:
																					return True
							return False


def    lowerCamelCase       (			UpperCAmelCase__				:  list[dict[str, int]]				,						UpperCAmelCase__				:  int				,						UpperCAmelCase__				:  int				,						UpperCAmelCase__				:  int		)			->	list[float]:


							'''simple docstring'''






							SCREAMING_SNAKE_CASE__     :List[Any]						    = [float('inf'		)] * vertex_count
							SCREAMING_SNAKE_CASE__     :Union[str, Any]						    = 0.0

							for _ in range(vertex_count - 1		):
														for j in range(__lowercase		):
																					SCREAMING_SNAKE_CASE__    ,      SCREAMING_SNAKE_CASE__    ,      SCREAMING_SNAKE_CASE__     :List[Any]						    = (graph[j][k] for k in ['src', 'dst', 'weight'])

																					if distance[u] != float('inf'		) and distance[u] + w < distance[v]:
																												SCREAMING_SNAKE_CASE__     :int						    = distance[u] + w

							SCREAMING_SNAKE_CASE__     :Optional[int]						    = check_negative_cycle(__lowercase				,						__lowercase				,						__lowercase		)
							if negative_cycle_exists:
														raise Exception('Negative cycle found'		)

							return distance


if __name__ == "__main__":
		import doctest

		doctest.testmod()

		UpperCamelCase_      	=	int(input('''Enter number of vertices: ''').strip())
		UpperCamelCase_      	=	int(input('''Enter number of edges: ''').strip())

		UpperCamelCase_      	=	[{} for _ in range(E)]

		for i in range(E):
				print('''Edge ''', i + 1)
				UpperCamelCase_      	=	(
				    int(x)
				    for x in input('''Enter source, destination, weight: ''').strip().split(''' ''')
				)
				UpperCamelCase_      	=	{"src": src, "dst": dest, "weight": weight}

		UpperCamelCase_      	=	int(input('''\nEnter shortest path source:''').strip())
		UpperCamelCase_      	=	bellman_ford(graph, V, E, source)
		print_distance(shortest_distance, 0)














def       _SCREAMING_SNAKE_CASE    (			__lowercase :      int     )    ->   list[int]:





    """simple docstring"""

    if length <= 0 or not isinstance(__lowercase      ,					__lowercase     ):
        raise ValueError("""Length must be a positive integer."""     )
    return [n * (2 * n - 1) for n in range(__lowercase     )]


if __name__ == "__main__":
  print(hexagonal_numbers(length=5))
  print(hexagonal_numbers(length=10))




