



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


class   __lowerCAmelCase  :
					"""simple docstring"""






					def __init__(  self       :							List[Any]					,       _snake_case       :							Tuple       ):






								"""simple docstring"""


								A__	  =     str(id_       )
								A__	  =     None
								A__	  =     None
								A__	  =     []
								A__	  =     {}  # {vertex:distance}



					def __lt__(  self       :							List[str]					,       _snake_case       :							Tuple       ):






								"""simple docstring"""


								return self.key < other.key



					def __repr__(  self       :							int       ):






								"""simple docstring"""


								return self.id



					def      _a				(  self       :							str					,       _snake_case       :							str       ):






								"""simple docstring"""


								self.neighbors.append(_snake_case       )



					def      _a				(  self       :							Tuple					,       _snake_case       :							str					,       _snake_case       :							Optional[Any]       ):






								"""simple docstring"""


								A__	  =     weight







def A    (							__UpperCamelCase			,						__UpperCamelCase			,						__UpperCamelCase			,						__UpperCamelCase       )    ->   Tuple:
			# add the neighbors:
			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]			,						__UpperCamelCase       )
			graph[b - 1].add_edge(graph[a - 1]			,						__UpperCamelCase       )


def A    (							__UpperCamelCase			,						__UpperCamelCase       )    ->   list:
			A__	  =     []
			for u in graph:
						A__	  =     math.inf
						A__	  =     None
			A__	  =     0
			A__	  =     graph[:]
			while q:
						A__	  =     min(__UpperCamelCase       )
						q.remove(__UpperCamelCase       )
						for v in u.neighbors:
									if (v in q) and (u.edges[v.id] < v.key):
												A__	  =     u
												A__	  =     u.edges[v.id]
			for i in range(1			,						len(__UpperCamelCase       )       ):
						a.append((int(graph[i].id       ) + 1, int(graph[i].pi.id       ) + 1)       )
			return a


def A    (							__UpperCamelCase			,						__UpperCamelCase       )    ->   Iterator[tuple]:
			for u in graph:
						A__	  =     math.inf
						A__	  =     None
			A__	  =     0

			A__	  =     list(__UpperCamelCase       )
			hq.heapify(__UpperCamelCase       )

			while h:
						A__	  =     hq.heappop(__UpperCamelCase       )
						for v in u.neighbors:
									if (v in h) and (u.edges[v.id] < v.key):
												A__	  =     u
												A__	  =     u.edges[v.id]
												hq.heapify(__UpperCamelCase       )

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


def A    (							)    ->   None:
			pass


if __name__ == "__main__":
							import doctest

							doctest.testmod()












UpperCamelCase    							=      8.3_144_598


def 				__lowerCamelCase     (							__lowerCAmelCase							:					float					,							__lowerCAmelCase							:					float							)     ->  float:
   if temperature < 0:
      raise Exception("""Temperature cannot be less than 0 K"""							)
   if molar_mass <= 0:
      raise Exception("""Molar mass cannot be less than or equal to 0 kg/mol"""							)
   else:
      return (3 * UNIVERSAL_GAS_CONSTANT * temperature / molar_mass) ** 0.5


if __name__ == "__main__":
       import doctest

       # run doctest
       doctest.testmod()

       # example
       UpperCamelCase    							=      300
       UpperCamelCase    							=      28
       UpperCamelCase    							=      rms_speed_of_molecule(temperature, molar_mass)
       print(F"""Vrms of Nitrogen gas at 300 K is {vrms} m/s""")



