





'''simple docstring'''

import heapq as hq
import math
from collections.abc import Iterator





class lowerCamelCase						:







  def __init__(		self     ,     lowercase__		)		->						Dict:






        """simple docstring"""





        _snake_case		:	Optional[int]					     =     str(id_		)
        _snake_case		:	Tuple					     =     None
        _snake_case		:	int					     =     None
        _snake_case		:	List[str]					     =     []
        _snake_case		:	Optional[Any]					     =     {}  # {vertex:distance}







  def __lt__(		self     ,     lowercase__		)		->						Optional[Any]:






        """simple docstring"""





        return self.key < other.key







  def __repr__(		self		)		->						Optional[int]:






        """simple docstring"""





        return self.id







  def 				UpperCAmelCase_				(		self     ,     lowercase__		)		->						Dict:






        """simple docstring"""





        self.neighbors.append(lowercase__		)







  def 				UpperCAmelCase_				(		self     ,     lowercase__     ,     lowercase__		)		->						Any:






        """simple docstring"""





        _snake_case		:	List[str]					     =     weight




def    _a    (							lowerCAmelCase_			,      lowerCAmelCase_			,      lowerCAmelCase_			,      lowerCAmelCase_	):





      """simple docstring"""



      graph[a - 1].add_neighbor(graph[b - 1]	)
      graph[b - 1].add_neighbor(graph[a - 1]	)
      # add the edges:
      graph[a - 1].add_edge(graph[b - 1]			,      lowerCAmelCase_	)
      graph[b - 1].add_edge(graph[a - 1]			,      lowerCAmelCase_	)




def    _a    (							lowerCAmelCase_			,      lowerCAmelCase_	):





      """simple docstring"""



      _snake_case		:	Union[str, Any]					     =     []
      for u in graph:
            _snake_case		:	str					     =     math.inf
            _snake_case		:	Dict					     =     None
      _snake_case		:	Dict					     =     0
      _snake_case		:	List[str]					     =     graph[:]
      while q:
            _snake_case		:	Tuple					     =     min(lowerCAmelCase_	)
            q.remove(lowerCAmelCase_	)
            for v in u.neighbors:
                  if (v in q) and (u.edges[v.id] < v.key):
                        _snake_case		:	int					     =     u
                        _snake_case		:	str					     =     u.edges[v.id]
      for i in range(1			,      len(lowerCAmelCase_	)	):
            a.append((int(graph[i].id	) + 1, int(graph[i].pi.id	) + 1)	)
      return a




def    _a    (							lowerCAmelCase_			,      lowerCAmelCase_	):





      """simple docstring"""



      for u in graph:
            _snake_case		:	Optional[Any]					     =     math.inf
            _snake_case		:	List[str]					     =     None
      _snake_case		:	Optional[int]					     =     0

      _snake_case		:	Any					     =     list(lowerCAmelCase_	)
      hq.heapify(lowerCAmelCase_	)

      while h:
            _snake_case		:	str					     =     hq.heappop(lowerCAmelCase_	)
            for v in u.neighbors:
                  if (v in h) and (u.edges[v.id] < v.key):
                        _snake_case		:	Tuple					     =     u
                        _snake_case		:	List[Any]					     =     u.edges[v.id]
                        hq.heapify(lowerCAmelCase_	)

      for i in range(1			,      len(lowerCAmelCase_	)	):
            yield (int(graph[i].id	) + 1, int(graph[i].pi.id	) + 1)




def    _a    (							):





      """simple docstring"""





if __name__ == "__main__":
   import doctest

   doctest.testmod()









'''simple docstring'''

import math

from numpy import inf
from scipy.integrate import quad




def    _a    (							lowerCAmelCase_	):





      """simple docstring"""



      if num <= 0:
            raise ValueError('''math domain error'''	)

      return quad(lowerCAmelCase_			,      0			,      lowerCAmelCase_			,      args=(lowerCAmelCase_)	)[0]




def    _a    (							lowerCAmelCase_			,      lowerCAmelCase_	):





      """simple docstring"""



      return math.pow(lowerCAmelCase_			,      z - 1	) * math.exp(-x	)


if __name__ == "__main__":
   from doctest import testmod

   testmod()


