



'''simple docstring'''





from __future__ import annotations

from collections.abc import Callable
from typing import Any, Generic, TypeVar

__a  			=						TypeVar("T")







class        UpperCAmelCase_			(			Generic[T]      ):
    """simple docstring"""







    def __init__(       self   :	Optional[int]					,	snake_case_   :	list[T]					,	snake_case_   :	Callable[[T, T], T]		):
          snake_case__    :       Any | T       		= None

          snake_case__    :       int       		= len(snake_case_		)
          snake_case__    :       list[T]       		= [any_type for _ in range(self.N		)] + arr
          snake_case__    :       Optional[int]       		= fnc
          self.build()




    def lowerCamelCase			(       self   :	Any		):
          for p in range(self.N - 1					,	0					,	-1		):
                snake_case__    :       Union[str, Any]       		= self.fn(self.st[p * 2]					,	self.st[p * 2 + 1]		)




    def lowerCamelCase			(       self   :	Optional[int]					,	snake_case_   :	int					,	snake_case_   :	T		):
          p += self.N
          snake_case__    :       Any       		= v
          while p > 1:
                snake_case__    :       Dict       		= p // 2
                snake_case__    :       List[str]       		= self.fn(self.st[p * 2]					,	self.st[p * 2 + 1]		)




    def lowerCamelCase			(       self   :	Optional[int]					,	snake_case_   :	int					,	snake_case_   :	int		):  # noqa: E741
          snake_case__		,							snake_case__    :       Dict       		= l + self.N, r + self.N

          snake_case__    :       T | None       		= None
          while l <= r:
                if l % 2 == 1:
                      snake_case__    :       Dict       		= self.st[l] if res is None else self.fn(snake_case_					,	self.st[l]		)
                if r % 2 == 0:
                      snake_case__    :       Optional[Any]       		= self.st[r] if res is None else self.fn(snake_case_					,	self.st[r]		)
                snake_case__		,							snake_case__    :       int       		= (l + 1) // 2, (r - 1) // 2
          return res


if __name__ == "__main__":
       from functools import reduce

       __a  			=						[1, 10, -2, 9, -3, 8, 4, -7, 5, 6, 11, -12]

       __a  			=						{
           0: 7,
           1: 2,
           2: 6,
           3: -14,
           4: 5,
           5: 4,
           6: 7,
           7: -10,
           8: 9,
           9: 10,
           10: 12,
           11: 1,
       }

       __a  			=						SegmentTree(test_array, min)
       __a  			=						SegmentTree(test_array, max)
       __a  			=						SegmentTree(test_array, lambda a, b: a + b)





       def 		__snake_case(							)						->					None:
             for i in range(len(_lowerCAmelCase						)						):
                   for j in range(_lowerCAmelCase	,  len(_lowerCAmelCase						)						):
                         snake_case__    :       Union[str, Any]       		= reduce(_lowerCAmelCase	,  test_array[i : j + 1]						)
                         snake_case__    :       Union[str, Any]       		= reduce(_lowerCAmelCase	,  test_array[i : j + 1]						)
                         snake_case__    :       int       		= reduce(lambda _lowerCAmelCase	,  _lowerCAmelCase						: a + b	,  test_array[i : j + 1]						)
                         assert min_range == min_segment_tree.query(_lowerCAmelCase	,  _lowerCAmelCase						)
                         assert max_range == max_segment_tree.query(_lowerCAmelCase	,  _lowerCAmelCase						)
                         assert sum_range == sum_segment_tree.query(_lowerCAmelCase	,  _lowerCAmelCase						)

       test_all_segments()

       for index, value in test_updates.items():
              __a  			=						value
              min_segment_tree.update(index, value)
              max_segment_tree.update(index, value)
              sum_segment_tree.update(index, value)
              test_all_segments()





'''simple docstring'''





def 		__snake_case(							)						->					Optional[Any]:
      for n in range(1	,  1_000_000						):
            yield n * (n + 1) // 2





def 		__snake_case(							_lowerCAmelCase						)						->					str:
      snake_case__    :       Optional[int]       		= 1
      snake_case__    :       List[Any]       		= 2
      while i * i <= n:
            snake_case__    :       Dict       		= 0
            while n % i == 0:
                  n //= i
                  multiplicity += 1
            divisors_count *= multiplicity + 1
            i += 1
      if n > 1:
            divisors_count *= 2
      return divisors_count





def 		__snake_case(							)						->					List[str]:
      return next(i for i in triangle_number_generator() if count_divisors(_lowerCAmelCase						) > 500						)


if __name__ == "__main__":
       print(solution())
