



from __future__ import annotations

import math




class 							lowerCAmelCase__  :







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







					def  _lowercase			(       self      :     str			,		_A      :     int):
											return idx * 2







					def  _lowercase			(       self      :     Any			,		_A      :     int):
											return idx * 2 + 1







					def  _lowercase			(       self      :     Tuple			,		_A      :     int			,		_A      :     int			,		_A      :     int			,		_A      :     list[int]):
											if left_element == right_element:
																	A__	:							Union[str, Any]						    = a[left_element - 1]
											else:
																	A__	:							Any						    = (left_element + right_element) // 2
																	self.build(self.left(_A)			,		_A			,		_A			,		_A)
																	self.build(self.right(_A)			,		mid + 1			,		_A			,		_A)
																	A__	:							Optional[Any]						    = max(
																	    self.segment_tree[self.left(_A)]			,		self.segment_tree[self.right(_A)])







					def  _lowercase			(       self      :     Any			,		_A      :     int			,		_A      :     int			,		_A      :     int			,		_A      :     int			,		_A      :     int			,		_A      :     int):
											if self.flag[idx] is True:
																	A__	:							str						    = self.lazy[idx]
																	A__	:							Dict						    = False
																	if left_element != right_element:
																							A__	:							Optional[int]						    = self.lazy[idx]
																							A__	:							Optional[Any]						    = self.lazy[idx]
																							A__	:							Any						    = True
																							A__	:							str						    = True

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







					def  _lowercase			(       self      :     Union[str, Any]			,		_A      :     int			,		_A      :     int			,		_A      :     int			,		_A      :     int			,		_A      :     int):
											if self.flag[idx] is True:
																	A__	:							List[str]						    = self.lazy[idx]
																	A__	:							Any						    = False
																	if left_element != right_element:
																							A__	:							List[Any]						    = self.lazy[idx]
																							A__	:							Optional[int]						    = self.lazy[idx]
																							A__	:							Optional[Any]						    = True
																							A__	:							List[str]						    = 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]
											A__	:							Any						    = (left_element + right_element) // 2
											A__	:							Any						    = self.query(self.left(_A)			,		_A			,		_A			,		_A			,		_A)
											A__	:							Any						    = self.query(self.right(_A)			,		mid + 1			,		_A			,		_A			,		_A)
											return max(_A			,		_A)







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


if __name__ == "__main__":
		snake_case    :						List[Any]  =						[1, 2, -4, 7, 3, -5, 6, 1_1, -2_0, 9, 1_4, 1_5, 5, 2, -8]
		snake_case    :						Tuple  =						1_5
		snake_case    :						Any  =						SegmentTree(size)
		segt.build(1, 1, size, A)
		print(segt.query(1, 1, size, 4, 6))
		print(segt.query(1, 1, size, 7, 1_1))
		print(segt.query(1, 1, size, 7, 1_2))
		segt.update(1, 1, size, 1, 3, 1_1_1)
		print(segt.query(1, 1, size, 1, 1_5))
		segt.update(1, 1, size, 7, 8, 2_3_5)
		print(segt)




from collections.abc import Callable

import numpy as np
def 	snake_case__       (					__lowercase							,     __lowercase							,     __lowercase							,     __lowercase							,     __lowercase       )		->		np.array:







						"""simple docstring"""

						A__	:							Any						    = int(np.ceil((x_end - xa) / step_size       )       )
						A__	:							Union[str, Any]						    = np.zeros((n + 1,)       )
						A__	:							Any						    = ya
						A__	:							Union[str, Any]						    = xa

						for k in range(__lowercase       ):
												A__	:							Any						    = y[k] + step_size * ode_func(__lowercase							,     y[k]       )
												A__	:							Any						    = y[k] + (
												    (step_size / 2) * (ode_func(__lowercase							,     y[k]       ) + ode_func(x + step_size							,     __lowercase       ))
												)
												x += step_size

						return y


if __name__ == "__main__":
		import doctest

		doctest.testmod()