


'''simple docstring'''






def 				UpperCamelCase_			(    A__					:   str							,    A__					:   Union[str, Any]					):
  '''simple docstring'''





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







def 				UpperCamelCase_			(    A__					:   Tuple							,    A__					:   Optional[int]					):
  '''simple docstring'''





  lowerCAmelCase_			:      Tuple			=   [[float("""inf"""					) for _ in range(A__					)] for _ in range(A__					)]

  for i in range(A__					):
    for j in range(A__					):
      lowerCAmelCase_			:      int			=   graph[i][j]

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

  _print_dist(A__							,    A__					)
  return dist, v


if __name__ == "__main__":
  __A					:  Optional[int]											=      int(input("Enter number of vertices: "))
  __A					:  Tuple											=      int(input("Enter number of edges: "))

  __A					:  Any											=      [[float("inf") for i in range(v)] for j in range(v)]

  for i in range(v):
    __A					:  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)
    __A					:  List[str]											=      int(input("Enter source:"))
    __A					:  List[str]											=      int(input("Enter destination:"))
    __A					:  Dict											=      float(input("Enter weight:"))
    __A					:  Optional[int]											=      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 				UpperCamelCase_			(    A__					:   int					):
  '''simple docstring'''





  lowerCAmelCase_			:      Union[str, Any]			=   (1 + 24 * n) ** 0.5
  return ((1 + root) / 6) % 1 == 0







def 				UpperCamelCase_			(    A__					:   int = 50_00					):
  '''simple docstring'''





  lowerCAmelCase_			:      Optional[int]			=   [(i * (3 * i - 1)) // 2 for i in range(1							,    A__					)]
  for i, pentagonal_i in enumerate(A__					):
    for j in range(A__							,    len(A__					)					):
      lowerCAmelCase_			:      int			=   pentagonal_nums[j]
      lowerCAmelCase_			:      Union[str, Any]			=   pentagonal_i + pentagonal_j
      lowerCAmelCase_			:      List[Any]			=   pentagonal_j - pentagonal_i
      if is_pentagonal(A__					) and is_pentagonal(A__					):
        return b

  return -1


if __name__ == "__main__":
  print(F'''{solution() = }''')



