




from __future__ import annotations

import math







class 				lowerCAmelCase_       :






				def __init__(			self      ,snake_case__ ):
							SCREAMING_SNAKE_CASE_   : List[Any]					  =      size
							# approximate the overall size of segment tree with given value
							SCREAMING_SNAKE_CASE_   : Union[str, Any]					  =      [0 for i in range(0      ,4 * size )]
							# create array to store lazy update
							SCREAMING_SNAKE_CASE_   : List[Any]					  =      [0 for i in range(0      ,4 * size )]
							SCREAMING_SNAKE_CASE_   : Any					  =      [0 for i in range(0      ,4 * size )]  # flag for lazy update






				def 		snake_case	(			self      ,snake_case__ ):
							return idx * 2






				def 		snake_case	(			self      ,snake_case__ ):
							return idx * 2 + 1






				def 		snake_case	(			self      ,snake_case__      ,snake_case__      ,snake_case__      ,snake_case__ ):
							if left_element == right_element:
										SCREAMING_SNAKE_CASE_   : List[str]					  =      a[left_element - 1]
							else:
										SCREAMING_SNAKE_CASE_   : Optional[int]					  =      (left_element + right_element) // 2
										self.build(self.left(snake_case__ )      ,snake_case__      ,snake_case__      ,snake_case__ )
										self.build(self.right(snake_case__ )      ,mid + 1      ,snake_case__      ,snake_case__ )
										SCREAMING_SNAKE_CASE_   : List[str]					  =      max(
										    self.segment_tree[self.left(snake_case__ )]      ,self.segment_tree[self.right(snake_case__ )] )






				def 		snake_case	(			self      ,snake_case__      ,snake_case__      ,snake_case__      ,snake_case__      ,snake_case__      ,snake_case__ ):
							if self.flag[idx] is True:
										SCREAMING_SNAKE_CASE_   : int					  =      self.lazy[idx]
										SCREAMING_SNAKE_CASE_   : Union[str, Any]					  =      False
										if left_element != right_element:
													SCREAMING_SNAKE_CASE_   : List[Any]					  =      self.lazy[idx]
													SCREAMING_SNAKE_CASE_   : str					  =      self.lazy[idx]
													SCREAMING_SNAKE_CASE_   : Any					  =      True
													SCREAMING_SNAKE_CASE_   : List[Any]					  =      True

							if right_element < a or left_element > b:
										return True
							if left_element >= a and right_element <= b:
										SCREAMING_SNAKE_CASE_   : Tuple					  =      val
										if left_element != right_element:
													SCREAMING_SNAKE_CASE_   : Any					  =      val
													SCREAMING_SNAKE_CASE_   : Tuple					  =      val
													SCREAMING_SNAKE_CASE_   : Optional[int]					  =      True
													SCREAMING_SNAKE_CASE_   : List[Any]					  =      True
										return True
							SCREAMING_SNAKE_CASE_   : Optional[Any]					  =      (left_element + right_element) // 2
							self.update(self.left(snake_case__ )      ,snake_case__      ,snake_case__      ,snake_case__      ,snake_case__      ,snake_case__ )
							self.update(self.right(snake_case__ )      ,mid + 1      ,snake_case__      ,snake_case__      ,snake_case__      ,snake_case__ )
							SCREAMING_SNAKE_CASE_   : Union[str, Any]					  =      max(
							    self.segment_tree[self.left(snake_case__ )]      ,self.segment_tree[self.right(snake_case__ )] )
							return True






				def 		snake_case	(			self      ,snake_case__      ,snake_case__      ,snake_case__      ,snake_case__      ,snake_case__ ):
							if self.flag[idx] is True:
										SCREAMING_SNAKE_CASE_   : str					  =      self.lazy[idx]
										SCREAMING_SNAKE_CASE_   : Tuple					  =      False
										if left_element != right_element:
													SCREAMING_SNAKE_CASE_   : Union[str, Any]					  =      self.lazy[idx]
													SCREAMING_SNAKE_CASE_   : Optional[int]					  =      self.lazy[idx]
													SCREAMING_SNAKE_CASE_   : str					  =      True
													SCREAMING_SNAKE_CASE_   : Optional[int]					  =      True
							if right_element < a or left_element > b:
										return -math.inf
							if left_element >= a and right_element <= b:
										return self.segment_tree[idx]
							SCREAMING_SNAKE_CASE_   : Any					  =      (left_element + right_element) // 2
							SCREAMING_SNAKE_CASE_   : int					  =      self.query(self.left(snake_case__ )      ,snake_case__      ,snake_case__      ,snake_case__      ,snake_case__ )
							SCREAMING_SNAKE_CASE_   : Optional[int]					  =      self.query(self.right(snake_case__ )      ,mid + 1      ,snake_case__      ,snake_case__      ,snake_case__ )
							return max(snake_case__      ,snake_case__ )






				def __str__(			self ):
							return str([self.query(1      ,1      ,self.size      ,snake_case__      ,snake_case__ ) for i in range(1      ,self.size + 1 )] )


if __name__ == "__main__":
						UpperCamelCase__ :   str						=							[1, 2, -4, 7, 3, -5, 6, 11, -20, 9, 14, 15, 5, 2, -8]
						UpperCamelCase__ :   int						=							15
						UpperCamelCase__ :   str						=							SegmentTree(size)
						segt.build(1, 1, size, A)
						print(segt.query(1, 1, size, 4, 6))
						print(segt.query(1, 1, size, 7, 11))
						print(segt.query(1, 1, size, 7, 12))
						segt.update(1, 1, size, 1, 3, 1_11)
						print(segt.query(1, 1, size, 1, 15))
						segt.update(1, 1, size, 7, 8, 2_35)
						print(segt)











__magic_name__   :  str        =							8.314_4598
def 		lowercase__  (				_UpperCamelCase       ,							_UpperCamelCase) ->			float:
      """simple docstring"""

      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
       __magic_name__   :  List[Any]        =							300
       __magic_name__   :  Union[str, Any]        =							28
       __magic_name__   :  str        =							rms_speed_of_molecule(temperature, molar_mass)
       print(F'Vrms of Nitrogen gas at 300 K is {vrms} m/s')



