



from __future__ import annotations

class        _A			:



       def __init__(						self				:	Optional[int]	,						__SCREAMING_SNAKE_CASE				:	int):


           '''simple docstring'''

           __a					=							vertices
           __a					=							[[0] * vertices for _ in range(__SCREAMING_SNAKE_CASE)]



       def 						_lowerCamelCase     (						self				:	Tuple	,						__SCREAMING_SNAKE_CASE				:	list[int]):


           '''simple docstring'''

           print('''Vertex \t Distance from Source''')
           for vertex in range(self.vertices):
               print(__SCREAMING_SNAKE_CASE	,						'''\t\t'''	,						distances_from_source[vertex])



       def 						_lowerCamelCase     (						self				:	Tuple	,						__SCREAMING_SNAKE_CASE				:	list[int]	,						__SCREAMING_SNAKE_CASE				:	list[bool]):


           '''simple docstring'''

           __a					=							1E7
           __a					=							0

           # Search not nearest vertex not in the shortest path tree
           for vertex in range(self.vertices):
               if distances_from_source[vertex] < minimum and visited[vertex] is False:
                   __a					=							distances_from_source[vertex]
                   __a					=							vertex
           return min_index





       def 						_lowerCamelCase     (						self				:	Dict	,						__SCREAMING_SNAKE_CASE				:	int):


           '''simple docstring'''

           __a					=							[int(1E7)] * self.vertices  # distances from the source
           __a					=							0
           __a					=							[False] * self.vertices

           for _ in range(self.vertices):
               __a					=							self.minimum_distance(__SCREAMING_SNAKE_CASE	,						__SCREAMING_SNAKE_CASE)
               __a					=							True

               # Update dist value of the adjacent vertices
               # of the picked vertex only if the current
               # distance is greater than new distance and
               # the vertex in not in the shortest path tree
               for v in range(self.vertices):
                   if (
                       self.graph[u][v] > 0
                       and visited[v] is False
                       and distances[v] > distances[u] + self.graph[u][v]
                   ):
                       __a					=							distances[u] + self.graph[u][v]

           self.print_solution(__SCREAMING_SNAKE_CASE)


if __name__ == "__main__":
 __snake_case		:Optional[int] 						=	Graph(9)
 __snake_case		:Tuple 						=	[
     [0, 4, 0, 0, 0, 0, 0, 8, 0],
     [4, 0, 8, 0, 0, 0, 0, 11, 0],
     [0, 8, 0, 7, 0, 4, 0, 0, 2],
     [0, 0, 7, 0, 9, 14, 0, 0, 0],
     [0, 0, 0, 9, 0, 10, 0, 0, 0],
     [0, 0, 4, 14, 10, 0, 2, 0, 0],
     [0, 0, 0, 0, 0, 2, 0, 1, 6],
     [8, 11, 0, 0, 0, 0, 1, 0, 7],
     [0, 0, 2, 0, 0, 0, 6, 7, 0],
 ]
 graph.dijkstra(0)










def 	__snake_case      (     _UpperCAmelCase							):
    __a					=							1
    __a					=							0
    __a					=							1
    __a					=							1
    __a					=							3
    __a					=							3
    __a					=							limit
    __a					=							0

    __a					=							''''''
    while counter != decimal + 1:
        if 4 * q + r - t < n * t:
            result += str(_UpperCAmelCase							)
            if counter == 0:
                result += "."

            if decimal == counter:
                break

            counter += 1
            __a					=							10 * (r - n * t)
            __a					=							((10 * (3 * q + r)) // t) - 10 * n
            q *= 10
            __a					=							nr
        else:
            __a					=							(2 * q + r) * l
            __a					=							(q * (7 * k) + 2 + (r * l)) // (t * l)
            q *= k
            t *= l
            l += 2
            k += 1
            __a					=							nn
            __a					=							nr
    return result





def 	__snake_case      (     ):
    print(f'{calculate_pi(50							) = }'							)
    import doctest

    doctest.testmod()


if __name__ == "__main__":
 main()





