


'''simple docstring'''







def    lowerCAmelCase__ (       lowerCamelCase  :    Tuple						,lowerCamelCase  :    Tuple     ):
       print('\nVertex Distance'     )
       for i in range(lowerCamelCase     ):
              if dist[i] != float('inf'     ):
                     print(lowerCamelCase						,'\t'						,int(dist[i]     )						,end='\t'     )
              else:
                     print(lowerCamelCase						,'\t'						,'INF'						,end='\t'     )
              print()






def    lowerCAmelCase__ (       lowerCamelCase  :    Any						,lowerCamelCase  :    Any						,lowerCamelCase  :    Tuple     ):
       _A  :			int											=      float('inf'     )
       _A  :			Any											=      -1
       for i in range(lowerCamelCase     ):
              if (not vset[i]) and mdist[i] < min_val:
                     _A  :			int											=      i
                     _A  :			Union[str, Any]											=      mdist[i]
       return min_ind






def    lowerCAmelCase__ (       lowerCamelCase  :    List[str]						,lowerCamelCase  :    str						,lowerCamelCase  :    Dict     ):
       _A  :			Dict											=      [float('inf'     ) for _ in range(lowerCamelCase     )]
       _A  :			Dict											=      [False for _ in range(lowerCamelCase     )]
       _A  :			List[str]											=      0.0

       for _ in range(v - 1     ):
              _A  :			Union[str, Any]											=      min_dist(lowerCamelCase						,lowerCamelCase						,lowerCamelCase     )
              _A  :			Union[str, Any]											=      True

              for i in range(lowerCamelCase     ):
                     if (
                         (not vset[i])
                         and graph[u][i] != float('inf'     )
                         and mdist[u] + graph[u][i] < mdist[i]
                     ):
                            _A  :			Union[str, Any]											=      mdist[u] + graph[u][i]

       print_dist(lowerCamelCase						,lowerCamelCase     )


if __name__ == "__main__":
   A   :  Union[str, Any]       		=				int(input('''Enter number of vertices: ''').strip())
   A   :  Tuple       		=				int(input('''Enter number of edges: ''').strip())

   A   :  List[Any]       		=				[[float('''inf''') for i in range(V)] for j in range(V)]

   for i in range(V):
      A   :  Any       		=				0.0

   for i in range(E):
      print('''\nEdge ''', i + 1)
      A   :  Optional[int]       		=				int(input('''Enter source:''').strip())
      A   :  List[str]       		=				int(input('''Enter destination:''').strip())
      A   :  Any       		=				float(input('''Enter weight:''').strip())
      A   :  List[str]       		=				weight

   A   :  Optional[Any]       		=				int(input('''\nEnter shortest path source:''').strip())
   dijkstra(graph, V, gsrc)










'''simple docstring'''







class 				__lowerCamelCase				:
    """simple docstring"""


    def __init__(						self    :							Optional[Any]):
           _A  :			Optional[Any]											=      [0]
           _A  :			Optional[Any]											=      0


    def      A					(						self    :							List[Any]   ,							SCREAMING_SNAKE_CASE    :							int):
           _A  :			Optional[Any]											=      self.__heap[i]
           while i // 2 > 0:
                  if self.__heap[i] > self.__heap[i // 2]:
                         _A  :			Dict											=      self.__heap[i // 2]
                         _A  :			Optional[Any]											=      temporary
                  i //= 2


    def      A					(						self    :							List[Any]   ,							SCREAMING_SNAKE_CASE    :							int):
           self.__heap.append(SCREAMING_SNAKE_CASE)
           self.__size += 1
           self.__swap_up(self.__size)


    def      A					(						self    :							int   ,							SCREAMING_SNAKE_CASE    :							int):
           while self.__size >= 2 * i:
                  if 2 * i + 1 > self.__size:
                         _A  :			Optional[int]											=      2 * i
                  else:
                         if self.__heap[2 * i] > self.__heap[2 * i + 1]:
                                _A  :			Any											=      2 * i
                         else:
                                _A  :			Optional[Any]											=      2 * i + 1
                  _A  :			List[str]											=      self.__heap[i]
                  if self.__heap[i] < self.__heap[bigger_child]:
                         _A  :			Union[str, Any]											=      self.__heap[bigger_child]
                         _A  :			Optional[int]											=      temporary
                  _A  :			Any											=      bigger_child


    def      A					(						self    :							List[str]):
           _A  :			str											=      self.__heap[1]
           _A  :			Tuple											=      self.__heap[self.__size]
           self.__size -= 1
           self.__heap.pop()
           self.__swap_down(1)
           return max_value


    @property
    def      A					(						self    :							int):
           return self.__heap[1:]


    def __len__(						self    :							List[str]):
           return self.__size


if __name__ == "__main__":
   import doctest

   doctest.testmod()
   # create an instance of BinaryHeap
   A   :  Dict       		=				BinaryHeap()
   binary_heap.insert(6)
   binary_heap.insert(10)
   binary_heap.insert(15)
   binary_heap.insert(12)
   # pop root(max-values because it is max heap)
   print(binary_heap.pop())  # 15
   print(binary_heap.pop())  # 12
   # get the list and size after operations
   print(binary_heap.get_list)
   print(len(binary_heap))






