



'''simple docstring'''






class 							a__:







    def __init__(   self				:						int		,    __snake_case				:						list[int]			):
      a		:      Any       =  len(__A			)
      a		:      List[Any]       =  [0] * len_array

      if len_array > 0:
        a		:      Tuple       =  array[0]

      for i in range(1		,    __A			):
        a		:      Any       =  self.prefix_sum[i - 1] + array[i]







    def     lowercase_ (   self				:						str		,    __snake_case				:						int		,    __snake_case				:						int			):
      if start == 0:
        return self.prefix_sum[end]

      return self.prefix_sum[end] - self.prefix_sum[start - 1]







    def     lowercase_ (   self				:						Union[str, Any]		,    __snake_case				:						int			):
      a		:      List[Any]       =  {0}
      for sum_item in self.prefix_sum:
        if sum_item - target_sum in sums:
          return True

        sums.add(__A			)

      return False


if __name__ == "__main__":
     import doctest

     doctest.testmod()










'''simple docstring'''






from math import factorial, pi
def    lowerCamelCase__ (		_A				,    _A = 30       ):

  if not isinstance(_A				,    (int, float)       ):
    raise ValueError('maclaurin_sin() requires either an int or float for theta'       )

  if not isinstance(_A				,    _A       ) or accuracy <= 0:
    raise ValueError('maclaurin_sin() requires a positive int for accuracy'       )

  a		:      List[Any]       =  float(_A       )
  a		:      Optional[int]       =  theta // (2 * pi)
  theta -= 2 * div * pi
  return sum(
      (-1) ** r * theta ** (2 * r + 1) / factorial(2 * r + 1       ) for r in range(_A       )       )
def    lowerCamelCase__ (		_A				,    _A = 30       ):

  if not isinstance(_A				,    (int, float)       ):
    raise ValueError('maclaurin_cos() requires either an int or float for theta'       )

  if not isinstance(_A				,    _A       ) or accuracy <= 0:
    raise ValueError('maclaurin_cos() requires a positive int for accuracy'       )

  a		:      List[str]       =  float(_A       )
  a		:      List[str]       =  theta // (2 * pi)
  theta -= 2 * div * pi
  return sum((-1) ** r * theta ** (2 * r) / factorial(2 * r       ) for r in range(_A       )       )


if __name__ == "__main__":
     import doctest

     doctest.testmod()

     print(maclaurin_sin(1_0))
     print(maclaurin_sin(-1_0))
     print(maclaurin_sin(1_0, 1_5))
     print(maclaurin_sin(-1_0, 1_5))

     print(maclaurin_cos(5))
     print(maclaurin_cos(-5))
     print(maclaurin_cos(1_0, 1_5))
     print(maclaurin_cos(-1_0, 1_5))