


'''simple docstring'''
from collections.abc import Sequence
from queue import Queue
class   lowercase      :

		"""simple docstring"""

		def __init__(						self       ,  UpperCamelCase_       ,  UpperCamelCase_       ,  UpperCamelCase_       ,  UpperCamelCase_=None       ,  UpperCamelCase_=None				):

							'''simple docstring'''


							UpperCamelCase__  :Optional[int]				   =					start
							UpperCamelCase__  :Optional[Any]				   =					end
							UpperCamelCase__  :Optional[Any]				   =					val
							UpperCamelCase__  :Any				   =					(start + end) // 2
							UpperCamelCase__  :Union[str, Any]				   =					left
							UpperCamelCase__  :Optional[Any]				   =					right




		def __repr__(						self				):

							'''simple docstring'''


							return F'''SegmentTreeNode(start={self.start}, end={self.end}, val={self.val})'''



class   lowercase      :

		"""simple docstring"""

		def __init__(						self       ,  UpperCamelCase_       ,  UpperCamelCase_				):

							'''simple docstring'''


							UpperCamelCase__  :Tuple				   =					collection
							UpperCamelCase__  :str				   =					function
							if self.collection:
												UpperCamelCase__  :List[str]				   =					self._build_tree(0       ,  len(UpperCamelCase_				) - 1				)




		def        lowerCAmelCase__							(						self       ,  UpperCamelCase_       ,  UpperCamelCase_				):

							'''simple docstring'''


							self._update_tree(self.root       ,  UpperCamelCase_       ,  UpperCamelCase_				)




		def        lowerCAmelCase__							(						self       ,  UpperCamelCase_       ,  UpperCamelCase_				):

							'''simple docstring'''


							return self._query_range(self.root       ,  UpperCamelCase_       ,  UpperCamelCase_				)




		def        lowerCAmelCase__							(						self       ,  UpperCamelCase_       ,  UpperCamelCase_				):

							'''simple docstring'''


							if start == end:
												return SegmentTreeNode(UpperCamelCase_       ,  UpperCamelCase_       ,  self.collection[start]				)
							UpperCamelCase__  :Union[str, Any]				   =					(start + end) // 2
							UpperCamelCase__  :Optional[int]				   =					self._build_tree(UpperCamelCase_       ,  UpperCamelCase_				)
							UpperCamelCase__  :Optional[int]				   =					self._build_tree(mid + 1       ,  UpperCamelCase_				)
							return SegmentTreeNode(UpperCamelCase_       ,  UpperCamelCase_       ,  self.fn(left.val       ,  right.val				)       ,  UpperCamelCase_       ,  UpperCamelCase_				)




		def        lowerCAmelCase__							(						self       ,  UpperCamelCase_       ,  UpperCamelCase_       ,  UpperCamelCase_				):

							'''simple docstring'''


							if node.start == i and node.end == i:
												UpperCamelCase__  :str				   =					val
												return
							if i <= node.mid:
												self._update_tree(node.left       ,  UpperCamelCase_       ,  UpperCamelCase_				)
							else:
												self._update_tree(node.right       ,  UpperCamelCase_       ,  UpperCamelCase_				)
							UpperCamelCase__  :Optional[int]				   =					self.fn(node.left.val       ,  node.right.val				)




		def        lowerCAmelCase__							(						self       ,  UpperCamelCase_       ,  UpperCamelCase_       ,  UpperCamelCase_				):

							'''simple docstring'''


							if node.start == i and node.end == j:
												return node.val

							if i <= node.mid:
												if j <= node.mid:
																	# range in left child tree
																	return self._query_range(node.left       ,  UpperCamelCase_       ,  UpperCamelCase_				)
												else:
																	# range in left child tree and right child tree
																	return self.fn(
																	    self._query_range(node.left       ,  UpperCamelCase_       ,  node.mid				)       ,  self._query_range(node.right       ,  node.mid + 1       ,  UpperCamelCase_				)       ,  )
							else:
												# range in right child tree
												return self._query_range(node.right       ,  UpperCamelCase_       ,  UpperCamelCase_				)




		def        lowerCAmelCase__							(						self				):

							'''simple docstring'''


							if self.root is not None:
												UpperCamelCase__  :Any				   =					Queue()
												queue.put(self.root				)
												while not queue.empty():
																	UpperCamelCase__  :Optional[int]				   =					queue.get()
																	yield node

																	if node.left is not None:
																						queue.put(node.left				)

																	if node.right is not None:
																						queue.put(node.right				)


if __name__ == "__main__":
		import operator

		for fn in [operator.add, max, min]:
				print('''*''' * 50)
				__snake_case				 =	SegmentTree([2, 1, 5, 3, 4], fn)
				for node in arr.traverse():
						print(node)
				print()

				arr.update(1, 5)
				for node in arr.traverse():
						print(node)
				print()

				print(arr.query_range(3, 4))  # 7
				print(arr.query_range(2, 2))  # 5
				print(arr.query_range(1, 3))  # 13
				print()



'''simple docstring'''
from __future__ import annotations

from math import pi, sqrt


def      a (     __a					,   __a  )    ->      tuple:



					'''simple docstring'''






					if inductance <= 0:
										raise ValueError('''Inductance cannot be 0 or negative'''  )

					elif capacitance <= 0:
										raise ValueError('''Capacitance cannot be 0 or negative'''  )

					else:
										return (
										    "Resonant frequency",
										    float(1 / (2 * pi * (sqrt(inductance * capacitance  )))  ),
										)


if __name__ == "__main__":
		import doctest

		doctest.testmod()