



'''simple docstring'''




from __future__ import annotations






class 						_UpperCamelCase  :


			'''simple docstring'''

			def __init__(							self					:			Optional[Any]							,					lowerCAmelCase__					:			List[Any]						):





					"""simple docstring"""






					__SCREAMING_SNAKE_CASE	:		List[str]   	=		value
					__SCREAMING_SNAKE_CASE	:		Node | None   	=		None
					__SCREAMING_SNAKE_CASE	:		Node | None   	=		None






class 						_UpperCamelCase  :


			'''simple docstring'''

			_A				:		int

			def __init__(							self					:			Union[str, Any]						):





					"""simple docstring"""






					__SCREAMING_SNAKE_CASE	:		Any   	=		0

			def UpperCamelCase__ (							self					:			List[str]							,					lowerCAmelCase__					:			Any							,					lowerCAmelCase__					:			Any						):





					"""simple docstring"""






					if node is None:
							return

					if path_sum == self.target:
							self.paths += 1

					if node.left:
							self.depth_first_search(node.left							,					path_sum + node.left.value						)
					if node.right:
							self.depth_first_search(node.right							,					path_sum + node.right.value						)



			def UpperCamelCase__ (							self					:			List[str]							,					lowerCAmelCase__					:			Tuple							,					lowerCAmelCase__					:			Tuple = None						):





					"""simple docstring"""






					if node is None:
							return 0
					if target is not None:
							__SCREAMING_SNAKE_CASE	:		List[Any]   	=		target

					self.depth_first_search(UpperCamelCase__							,					node.value						)
					self.path_sum(node.left						)
					self.path_sum(node.right						)

					return self.paths


if __name__ == "__main__":
						import doctest

						doctest.testmod()




'''simple docstring'''




UpperCamelCase__	:     List[Any]    =			10_00


def     lowerCAmelCase_       (     _lowerCamelCase:       float ):
		return x * x


def     lowerCAmelCase_       (     _lowerCamelCase:       Any	,				_lowerCamelCase:       float	,				_lowerCamelCase:       float	,				_lowerCamelCase:       int = 4 ):
		assert callable(
		    _lowerCamelCase ), F"the function(object) passed should be callable your input : {function}"
		assert isinstance(_lowerCamelCase	,				(float, int) ), F"a should be float or integer your input : {a}"
		assert isinstance(function(_lowerCamelCase )	,				(float, int) ), (
		    "the function should return integer or float return type of your function, "
		    F"{type(_lowerCamelCase )}"
		)
		assert isinstance(_lowerCamelCase	,				(float, int) ), F"b should be float or integer your input : {b}"
		assert (
		    isinstance(_lowerCamelCase	,				_lowerCamelCase ) and precision > 0
		), F"precision should be positive integer your input : {precision}"

		# just applying the formula of simpson for approximate integration written in
		# mentioned article in first comment of this file and above this function

		__SCREAMING_SNAKE_CASE	:		List[Any]   	=		(b - a) / N_STEPS
		__SCREAMING_SNAKE_CASE	:		List[Any]   	=		function(_lowerCamelCase ) + function(_lowerCamelCase )

		for i in range(1	,				_lowerCamelCase ):
				__SCREAMING_SNAKE_CASE	:		Union[str, Any]   	=		a + h * i
				result += function(_lowerCamelCase ) * (4 if i % 2 else 2)

		result *= h / 3
		return round(_lowerCamelCase	,				_lowerCamelCase )


if __name__ == "__main__":
						import doctest

						doctest.testmod()