

import math


class 					A		:







    """simple docstring"""





    def __init__( self					:			str,lowercase_					:			Dict						)->       Optional[Any]:





        '''simple docstring'''







        A__        =  len(__UpperCamelCase						)
        A__        =  [0] * (
            4 * self.N
        )  # approximate the overall size of segment tree with array N
        self.build(1,0,self.N - 1						)


    def 		snake_case__	( self					:			List[Any],lowercase_					:			str						)->       Dict:





        '''simple docstring'''







        return idx * 2


    def 		snake_case__	( self					:			str,lowercase_					:			List[Any]						)->       Optional[int]:





        '''simple docstring'''







        return idx * 2 + 1


    def 		snake_case__	( self					:			str,lowercase_					:			Any,lowercase_					:			str,lowercase_					:			str						)->       Dict:  # noqa: E741





        '''simple docstring'''







        if l == r:
            A__        =  A[l]
        else:
            A__        =  (l + r) // 2
            self.build(self.left(__UpperCamelCase						),__UpperCamelCase,__UpperCamelCase						)
            self.build(self.right(__UpperCamelCase						),mid + 1,__UpperCamelCase						)
            A__        =  max(self.st[self.left(__UpperCamelCase						)],self.st[self.right(__UpperCamelCase						)]						)


    def 		snake_case__	( self					:			List[str],lowercase_					:			List[str],lowercase_					:			int,lowercase_					:			int						)->       Dict:





        '''simple docstring'''







        return self.update_recursive(1,0,self.N - 1,a - 1,b - 1,__UpperCamelCase						)


    def 		snake_case__	( self					:			Tuple,lowercase_					:			List[str],lowercase_					:			List[Any],lowercase_					:			List[str],lowercase_					:			str,lowercase_					:			int,lowercase_					:			Dict						)->       List[Any]:  # noqa: E741





        '''simple docstring'''







        if r < a or l > b:
            return True
        if l == r:
            A__        =  val
            return True
        A__        =  (l + r) // 2
        self.update_recursive(self.left(__UpperCamelCase						),__UpperCamelCase,__UpperCamelCase,__UpperCamelCase,__UpperCamelCase,__UpperCamelCase						)
        self.update_recursive(self.right(__UpperCamelCase						),mid + 1,__UpperCamelCase,__UpperCamelCase,__UpperCamelCase,__UpperCamelCase						)
        A__        =  max(self.st[self.left(__UpperCamelCase						)],self.st[self.right(__UpperCamelCase						)]						)
        return True


    def 		snake_case__	( self					:			Optional[Any],lowercase_					:			Dict,lowercase_					:			List[Any]						)->       str:





        '''simple docstring'''







        return self.query_recursive(1,0,self.N - 1,a - 1,b - 1						)


    def 		snake_case__	( self					:			Dict,lowercase_					:			int,lowercase_					:			Dict,lowercase_					:			Tuple,lowercase_					:			Any,lowercase_					:			List[Any]						)->       Optional[Any]:  # noqa: E741





        '''simple docstring'''







        if r < a or l > b:
            return -math.inf
        if l >= a and r <= b:
            return self.st[idx]
        A__        =  (l + r) // 2
        A__        =  self.query_recursive(self.left(__UpperCamelCase						),__UpperCamelCase,__UpperCamelCase,__UpperCamelCase,__UpperCamelCase						)
        A__        =  self.query_recursive(self.right(__UpperCamelCase						),mid + 1,__UpperCamelCase,__UpperCamelCase,__UpperCamelCase						)
        return max(__UpperCamelCase,__UpperCamelCase						)


    def 		snake_case__	( self					:			Optional[int]						)->       Optional[Any]:





        '''simple docstring'''







        A__        =  []
        for i in range(1,N + 1						):
            show_list += [self.query(__UpperCamelCase,__UpperCamelCase						)]
        print(__UpperCamelCase						)


if __name__ == "__main__":
     lowercase_									=    [1, 2, -4, 7, 3, -5, 6, 11, -20, 9, 14, 15, 5, 2, -8]
     lowercase_									=    15
     lowercase_									=    SegmentTree(A)
     print(segt.query(4, 6))
     print(segt.query(7, 11))
     print(segt.query(7, 12))
     segt.update(1, 3, 111)
     print(segt.query(1, 15))
     segt.update(7, 8, 235)
     segt.show_data()






'''simple docstring'''



from __future__ import annotations

# Define the Gravitational Constant G and the function
_lowercase       :						List[str]						=6.6743E-11  # unit of G : m^3 * kg^-1 * s^-2


def 							__UpperCAmelCase				(				UpperCamelCase__				:float   ,				UpperCamelCase__				:float   ,				UpperCamelCase__				:float   ,				UpperCamelCase__				:float			)		->						dict[str, float]:
				snake_case__      :   str      =    mass_a * mass_a

				if (force, mass_a, mass_a, distance).count(0			) != 1:
								raise ValueError('''One and only one argument must be 0'''			)
				if force < 0:
								raise ValueError('''Gravitational force can not be negative'''			)
				if distance < 0:
								raise ValueError('''Distance can not be negative'''			)
				if mass_a < 0 or mass_a < 0:
								raise ValueError('''Mass can not be negative'''			)
				if force == 0:
								snake_case__      :   Dict      =    GRAVITATIONAL_CONSTANT * product_of_mass / (distance**2)
								return {"force": force}
				elif mass_a == 0:
								snake_case__      :   List[str]      =    (force) * (distance**2) / (GRAVITATIONAL_CONSTANT * mass_a)
								return {"mass_1": mass_a}
				elif mass_a == 0:
								snake_case__      :   List[Any]      =    (force) * (distance**2) / (GRAVITATIONAL_CONSTANT * mass_a)
								return {"mass_2": mass_a}
				elif distance == 0:
								snake_case__      :   str      =    (GRAVITATIONAL_CONSTANT * product_of_mass / (force)) ** 0.5
								return {"distance": distance}
				raise ValueError('''One and only one argument must be 0'''			)


# Run doctest
if __name__ == "__main__":
				import doctest

				doctest.testmod()




