



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



def    snake_case_				(    _SCREAMING_SNAKE_CASE  ,	_SCREAMING_SNAKE_CASE   ):
	__lowercase		       =			[[float("inf"   ) for _ in range(_SCREAMING_SNAKE_CASE   )] for _ in range(_SCREAMING_SNAKE_CASE   )]

	for i in range(_SCREAMING_SNAKE_CASE   ):
		for j in range(_SCREAMING_SNAKE_CASE   ):
			__lowercase		       =			graph[i][j]

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

	_print_dist(_SCREAMING_SNAKE_CASE  ,	_SCREAMING_SNAKE_CASE   )
	return dist, v


if __name__ == "__main__":
	snake_case__					:     Dict    		=   int(input("""Enter number of vertices: """))
	snake_case__					:     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[int]    		=   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__					:     Union[str, Any]    		=   int(input("""Enter source:"""))
		snake_case__					:     Optional[Any]    		=   int(input("""Enter destination:"""))
		snake_case__					:     int    		=   float(input("""Enter weight:"""))
		snake_case__					:     Dict    		=   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








import os
import sys
from contextlib import contextmanager


# Windows only
if os.name == "nt":
	import ctypes
	import msvcrt  # noqa

	class   _A   ( ctypes.Structure	):


							'''simple docstring'''





							_snake_case			:     Optional[Any]      							=      [("""size""", ctypes.c_int), ("""visible""", ctypes.c_byte)]



def    snake_case_				(    ):
	if os.name == "nt":
		__lowercase		       =			CursorInfo()
		__lowercase		       =			ctypes.windll.kernelaa.GetStdHandle(-1_1   )
		ctypes.windll.kernelaa.GetConsoleCursorInfo(_SCREAMING_SNAKE_CASE  ,	ctypes.byref(_SCREAMING_SNAKE_CASE   )   )
		__lowercase		       =			False
		ctypes.windll.kernelaa.SetConsoleCursorInfo(_SCREAMING_SNAKE_CASE  ,	ctypes.byref(_SCREAMING_SNAKE_CASE   )   )
	elif os.name == "posix":
		sys.stdout.write("\033[?25l"   )
		sys.stdout.flush()



def    snake_case_				(    ):
	if os.name == "nt":
		__lowercase		       =			CursorInfo()
		__lowercase		       =			ctypes.windll.kernelaa.GetStdHandle(-1_1   )
		ctypes.windll.kernelaa.GetConsoleCursorInfo(_SCREAMING_SNAKE_CASE  ,	ctypes.byref(_SCREAMING_SNAKE_CASE   )   )
		__lowercase		       =			True
		ctypes.windll.kernelaa.SetConsoleCursorInfo(_SCREAMING_SNAKE_CASE  ,	ctypes.byref(_SCREAMING_SNAKE_CASE   )   )
	elif os.name == "posix":
		sys.stdout.write("\033[?25h"   )
		sys.stdout.flush()



@contextmanager
def    snake_case_				(    ):
	try:
		hide_cursor()
		yield
	finally:
		show_cursor()



