
'''simple docstring'''







import math






class 				lowerCAmelCase__     :






					def __init__(     self       ,							__SCREAMING_SNAKE_CASE	):


											"""simple docstring"""





											lowercase_			:  List[Any]									= len(__SCREAMING_SNAKE_CASE	)
											lowercase_			:  Optional[int]									= [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       ,							__SCREAMING_SNAKE_CASE	):


											"""simple docstring"""





											return idx * 2






					def 			_snake_case					(     self       ,							__SCREAMING_SNAKE_CASE	):


											"""simple docstring"""





											return idx * 2 + 1






					def 			_snake_case					(     self       ,							__SCREAMING_SNAKE_CASE       ,							__SCREAMING_SNAKE_CASE       ,							__SCREAMING_SNAKE_CASE	):  # noqa: E741


											"""simple docstring"""





											if l == r:
																	lowercase_			:  int									= A[l]
											else:
																	lowercase_			:  List[Any]									= (l + r) // 2
																	self.build(self.left(__SCREAMING_SNAKE_CASE	)       ,							__SCREAMING_SNAKE_CASE       ,							__SCREAMING_SNAKE_CASE	)
																	self.build(self.right(__SCREAMING_SNAKE_CASE	)       ,							mid + 1       ,							__SCREAMING_SNAKE_CASE	)
																	lowercase_			:  str									= max(self.st[self.left(__SCREAMING_SNAKE_CASE	)]       ,							self.st[self.right(__SCREAMING_SNAKE_CASE	)]	)






					def 			_snake_case					(     self       ,							__SCREAMING_SNAKE_CASE       ,							__SCREAMING_SNAKE_CASE       ,							__SCREAMING_SNAKE_CASE	):


											"""simple docstring"""





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






					def 			_snake_case					(     self       ,							__SCREAMING_SNAKE_CASE       ,							__SCREAMING_SNAKE_CASE       ,							__SCREAMING_SNAKE_CASE       ,							__SCREAMING_SNAKE_CASE       ,							__SCREAMING_SNAKE_CASE       ,							__SCREAMING_SNAKE_CASE	):  # noqa: E741


											"""simple docstring"""





											if r < a or l > b:
																	return True
											if l == r:
																	lowercase_			:  Any									= val
																	return True
											lowercase_			:  Union[str, Any]									= (l + r) // 2
											self.update_recursive(self.left(__SCREAMING_SNAKE_CASE	)       ,							__SCREAMING_SNAKE_CASE       ,							__SCREAMING_SNAKE_CASE       ,							__SCREAMING_SNAKE_CASE       ,							__SCREAMING_SNAKE_CASE       ,							__SCREAMING_SNAKE_CASE	)
											self.update_recursive(self.right(__SCREAMING_SNAKE_CASE	)       ,							mid + 1       ,							__SCREAMING_SNAKE_CASE       ,							__SCREAMING_SNAKE_CASE       ,							__SCREAMING_SNAKE_CASE       ,							__SCREAMING_SNAKE_CASE	)
											lowercase_			:  Optional[int]									= max(self.st[self.left(__SCREAMING_SNAKE_CASE	)]       ,							self.st[self.right(__SCREAMING_SNAKE_CASE	)]	)
											return True






					def 			_snake_case					(     self       ,							__SCREAMING_SNAKE_CASE       ,							__SCREAMING_SNAKE_CASE	):


											"""simple docstring"""





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






					def 			_snake_case					(     self       ,							__SCREAMING_SNAKE_CASE       ,							__SCREAMING_SNAKE_CASE       ,							__SCREAMING_SNAKE_CASE       ,							__SCREAMING_SNAKE_CASE       ,							__SCREAMING_SNAKE_CASE	):  # noqa: E741


											"""simple docstring"""





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






					def 			_snake_case					(     self	):


											"""simple docstring"""





											lowercase_			:  Optional[Any]									= []
											for i in range(1       ,							N + 1	):
																	show_list += [self.query(__SCREAMING_SNAKE_CASE       ,							__SCREAMING_SNAKE_CASE	)]
											print(__SCREAMING_SNAKE_CASE	)


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





'''simple docstring'''







import math
def       snake_case_	(       __SCREAMING_SNAKE_CASE      :				int							):



						"""simple docstring"""





						if 1 < number < 4:
												# 2 and 3 are primes
												return True
						elif number < 2 or number % 2 == 0 or number % 3 == 0:
												# Negatives, 0, 1, all even numbers, all multiples of 3 are not primes
												return False

						# All primes number are in format of 6k +/- 1
						for i in range(5   ,   int(math.sqrt(__SCREAMING_SNAKE_CASE							) + 1							)   ,   6							):
												if number % i == 0 or number % (i + 2) == 0:
																		return False
						return True
def       snake_case_	(       __SCREAMING_SNAKE_CASE      :				int = 2000000							):



						"""simple docstring"""





						return sum(num for num in range(3   ,   __SCREAMING_SNAKE_CASE   ,   2							) if is_prime(__SCREAMING_SNAKE_CASE							)							) + 2 if n > 2 else 0


if __name__ == "__main__":
							print(f"""{solution() = }""")



