





from __future__ import annotations


class 					__magic_name__  :





     """simple docstring"""



     def __init__(							self       :List[Any]			,      snake_case       :int  ):





        '''simple docstring'''




        A_					:				List[Any]          =			vertices
        A_					:				Optional[Any]          =			[[0] * vertices for _ in range(snake_case  )]



     def 						SCREAMING_SNAKE_CASE		(							self       :List[str]			,      snake_case       :list[int]  ):





        '''simple docstring'''




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



     def 						SCREAMING_SNAKE_CASE		(							self       :Union[str, Any]			,      snake_case       :list[int]			,      snake_case       :list[bool]  ):





        '''simple docstring'''




        A_					:				Dict          =			1e7
        A_					:				List[str]          =			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_					:				Tuple          =			distances_from_source[vertex]
              A_					:				List[str]          =			vertex
        return min_index





     def 						SCREAMING_SNAKE_CASE		(							self       :Optional[int]			,      snake_case       :int  ):





        '''simple docstring'''




        A_					:				Union[str, Any]          =			[int(1e7  )] * self.vertices  # distances from the source
        A_					:				Dict          =			0
        A_					:				Any          =			[False] * self.vertices

        for _ in range(self.vertices  ):
           A_					:				List[Any]          =			self.minimum_distance(snake_case			,      snake_case  )
           A_					:				Optional[Any]          =			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_					:				str          =			distances[u] + self.graph[u][v]

        self.print_solution(snake_case  )


if __name__ == "__main__":
 _lowerCAmelCase							:      str						=	Graph(9)
 _lowerCAmelCase							:      Dict						=	[
     [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						(					_lowerCAmelCase : float				,				_lowerCAmelCase : float				,				_lowerCAmelCase : int	) ->						float:
   A_					:				List[str]          =			[1 / first_term]
   A_					:				Tuple          =			1 / first_term
   for _ in range(number_of_terms - 1	):
      first_term += common_difference
      arithmetic_progression.append(_lowerCAmelCase	)
   A_					:				List[str]          =			[1 / step for step in arithmetic_progression]
   return sum(_lowerCAmelCase	)


if __name__ == "__main__":
 import doctest

 doctest.testmod()
 print(sum_of_harmonic_progression(1 / 2, 2, 2))
