



from math import factorial, pi



def 	__a					(   lowerCAmelCase_       : float      ,lowerCAmelCase_       : int = 30    )				->			float:






						'''simple docstring'''



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

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

						UpperCAmelCase_=       float(lowerCAmelCase_    )
						UpperCAmelCase_=       theta // (2 * pi)
						theta -= 2 * div * pi
						return sum(
						    (-1) ** r * theta ** (2 * r + 1) / factorial(2 * r + 1    ) for r in range(lowerCAmelCase_    )    )



def 	__a					(   lowerCAmelCase_       : float      ,lowerCAmelCase_       : int = 30    )				->			float:






						'''simple docstring'''



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

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

						UpperCAmelCase_=       float(lowerCAmelCase_    )
						UpperCAmelCase_=       theta // (2 * pi)
						theta -= 2 * div * pi
						return sum((-1) ** r * theta ** (2 * r) / factorial(2 * r    ) for r in range(lowerCAmelCase_    )    )


if __name__ == "__main__":
	import doctest

	doctest.testmod()

	print(maclaurin_sin(10))
	print(maclaurin_sin(-10))
	print(maclaurin_sin(10, 15))
	print(maclaurin_sin(-10, 15))

	print(maclaurin_cos(5))
	print(maclaurin_cos(-5))
	print(maclaurin_cos(10, 15))
	print(maclaurin_cos(-10, 15))









from __future__ import annotations



def 	__a					(   lowerCAmelCase_       : list[int]      ,lowerCAmelCase_       : int    )				->			list[list[int]]:






						'''simple docstring'''



						UpperCAmelCase_=       []
						UpperCAmelCase_=       []
						UpperCAmelCase_=       0
						UpperCAmelCase_=       sum(lowerCAmelCase_    )
						create_state_space_tree(lowerCAmelCase_      ,lowerCAmelCase_      ,lowerCAmelCase_      ,lowerCAmelCase_      ,lowerCAmelCase_      ,lowerCAmelCase_    )
						return result



def 	__a					(   lowerCAmelCase_       : list[int]      ,lowerCAmelCase_       : int      ,lowerCAmelCase_       : int      ,lowerCAmelCase_       : list[int]      ,lowerCAmelCase_       : list[list[int]]      ,lowerCAmelCase_       : int      ,)				->			None:






						'''simple docstring'''



						if sum(lowerCAmelCase_    ) > max_sum or (remaining_nums_sum + sum(lowerCAmelCase_    )) < max_sum:
												return
						if sum(lowerCAmelCase_    ) == max_sum:
												result.append(lowerCAmelCase_    )
												return
						for index in range(lowerCAmelCase_      ,len(lowerCAmelCase_    )    ):
												create_state_space_tree(
												    lowerCAmelCase_      ,lowerCAmelCase_      ,index + 1      ,[*path, nums[index]]      ,lowerCAmelCase_      ,remaining_nums_sum - nums[index]      ,)
__A       =						[3, 34, 4, 12, 5, 2]
__A       =						9
__A       =						generate_sum_of_subsets_soln(nums, max_sum)



print(*result)




