
"""simple docstring"""




import heapq



def 				a__			(					lowerCAmelCase						:							Tuple							,     lowerCAmelCase						:							Optional[int]							,     lowerCAmelCase						:							Any		):






     '''simple docstring'''
     UpperCAmelCase__				:			List[Any]							=    [(0, start)]  # cost from start node,end node
     UpperCAmelCase__				:			Tuple							=    set()
     while heap:
          ((UpperCAmelCase__)				,						(UpperCAmelCase__))				:			Dict							=    heapq.heappop(lowerCAmelCase		)
          if u in visited:
               continue
          visited.add(lowerCAmelCase		)
          if u == end:
               return cost
          for v, c in graph[u]:
               if v in visited:
                    continue
               UpperCAmelCase__				:			List[Any]							=    cost + c
               heapq.heappush(lowerCAmelCase							,     (next_item, v)		)
     return -1


A__   :						Dict 							=     {
    """A""": [["""B""", 2], ["""C""", 5]],
    """B""": [["""A""", 2], ["""D""", 3], ["""E""", 1], ["""F""", 1]],
    """C""": [["""A""", 5], ["""F""", 3]],
    """D""": [["""B""", 3]],
    """E""": [["""B""", 4], ["""F""", 3]],
    """F""": [["""C""", 3], ["""E""", 3]],
}
A__   :						Tuple 							=     {
    """B""": [["""C""", 1]],
    """C""": [["""D""", 1]],
    """D""": [["""F""", 1]],
    """E""": [["""B""", 1], ["""F""", 3]],
    """F""": [],
}
A__   :						Optional[int] 							=     {
    """B""": [["""C""", 1]],
    """C""": [["""D""", 1]],
    """D""": [["""F""", 1]],
    """E""": [["""B""", 1], ["""G""", 2]],
    """F""": [],
    """G""": [["""F""", 1]],
}

A__   :						str 							=     dijkstra(G, """E""", """C""")
print(short_distance)  # E -- 3 --> F -- 3 --> C == 6

A__   :						Union[str, Any] 							=     dijkstra(Ga, """E""", """F""")
print(short_distance)  # E -- 3 --> F == 3

A__   :						Tuple 							=     dijkstra(Ga, """E""", """F""")
print(short_distance)  # E -- 2 --> G -- 1 --> F == 3

if __name__ == "__main__":
    import doctest

    doctest.testmod()





"""simple docstring"""




def 				a__			(					lowerCAmelCase						:							int		):






     '''simple docstring'''
     if number != int(lowerCAmelCase		):
          raise ValueError("factorial() only accepts integral values"		)
     if number < 0:
          raise ValueError("factorial() not defined for negative values"		)
     UpperCAmelCase__				:			int							=    1
     for i in range(1							,     number + 1		):
          value *= i
     return value



def 				a__			(					lowerCAmelCase						:							int		):






     '''simple docstring'''
     if not isinstance(lowerCAmelCase							,     lowerCAmelCase		):
          raise ValueError("factorial() only accepts integral values"		)
     if n < 0:
          raise ValueError("factorial() not defined for negative values"		)
     return 1 if n == 0 or n == 1 else n * factorial(n - 1		)


if __name__ == "__main__":
    import doctest

    doctest.testmod()

    A__   :						Any 							=     int(input("""Enter a positive integer: """).strip() or 0)
    print(f"""factorial{n} is {factorial(n)}""")



