






"""simple docstring"""
from math import factorial, pi

def 							snake_case (  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"		)

			UpperCAmelCase_	:					List[str]     	=   float(A__		)
			UpperCAmelCase_	:					Optional[Any]     	=   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 							snake_case (  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"		)

			UpperCAmelCase_	:					Dict     	=   float(A__		)
			UpperCAmelCase_	:					Optional[Any]     	=   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(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))











"""simple docstring"""
from __future__ import annotations

from fractions import Fraction
from math import gcd, sqrt

def 							snake_case (  A__		):
			UpperCAmelCase_	:					int     	=   int(number**0.5		)
			return number == sq * sq

def 							snake_case (  A__      ,A__      ,A__      ,A__      ,A__      ,A__		):
			UpperCAmelCase_	:					int     	=   x_num * y_den * z_den + y_num * x_den * z_den + z_num * x_den * y_den
			UpperCAmelCase_	:					int     	=   x_den * y_den * z_den
			UpperCAmelCase_	:					int     	=   gcd(A__      ,A__		)
			top //= hcf
			bottom //= hcf
			return top, bottom

def 							snake_case (  A__ = 35		):
			UpperCAmelCase_	:					set     	=   set()
			UpperCAmelCase_	:					int
			UpperCAmelCase_	:					Fraction     	=   Fraction(0		)
			UpperCAmelCase_	:					tuple[int, int]

			for x_num in range(1      ,order + 1		):
						for x_den in range(x_num + 1      ,order + 1		):
									for y_num in range(1      ,order + 1		):
												for y_den in range(y_num + 1      ,order + 1		):
															# n=1
															UpperCAmelCase_	:					Optional[int]     	=   x_num * y_den + x_den * y_num
															UpperCAmelCase_	:					List[Any]     	=   x_den * y_den
															UpperCAmelCase_	:					Tuple     	=   gcd(A__      ,A__		)
															z_num //= hcf
															z_den //= hcf
															if 0 < z_num < z_den <= order:
																		UpperCAmelCase_	:					int     	=   add_three(
																		    A__      ,A__      ,A__      ,A__      ,A__      ,A__		)
																		unique_s.add(A__		)

															# n=2
															UpperCAmelCase_	:					Optional[Any]     	=   (
															    x_num * x_num * y_den * y_den + x_den * x_den * y_num * y_num
															)
															UpperCAmelCase_	:					Dict     	=   x_den * x_den * y_den * y_den
															if is_sq(A__		) and is_sq(A__		):
																		UpperCAmelCase_	:					int     	=   int(sqrt(A__		)		)
																		UpperCAmelCase_	:					Any     	=   int(sqrt(A__		)		)
																		UpperCAmelCase_	:					str     	=   gcd(A__      ,A__		)
																		z_num //= hcf
																		z_den //= hcf
																		if 0 < z_num < z_den <= order:
																					UpperCAmelCase_	:					Tuple     	=   add_three(
																					    A__      ,A__      ,A__      ,A__      ,A__      ,A__		)
																					unique_s.add(A__		)

                    # n=-1
															UpperCAmelCase_	:					Optional[int]     	=   x_num * y_num
															UpperCAmelCase_	:					Dict     	=   x_den * y_num + x_num * y_den
															UpperCAmelCase_	:					Union[str, Any]     	=   gcd(A__      ,A__		)
															z_num //= hcf
															z_den //= hcf
															if 0 < z_num < z_den <= order:
																		UpperCAmelCase_	:					List[Any]     	=   add_three(
																		    A__      ,A__      ,A__      ,A__      ,A__      ,A__		)
																		unique_s.add(A__		)

															# n=2
															UpperCAmelCase_	:					Optional[Any]     	=   x_num * x_num * y_num * y_num
															UpperCAmelCase_	:					Dict     	=   (
															    x_den * x_den * y_num * y_num + x_num * x_num * y_den * y_den
															)
															if is_sq(A__		) and is_sq(A__		):
																		UpperCAmelCase_	:					str     	=   int(sqrt(A__		)		)
																		UpperCAmelCase_	:					int     	=   int(sqrt(A__		)		)
																		UpperCAmelCase_	:					Optional[Any]     	=   gcd(A__      ,A__		)
																		z_num //= hcf
																		z_den //= hcf
																		if 0 < z_num < z_den <= order:
																					UpperCAmelCase_	:					Optional[int]     	=   add_three(
																					    A__      ,A__      ,A__      ,A__      ,A__      ,A__		)
																					unique_s.add(A__		)

			for num, den in unique_s:
						total += Fraction(A__      ,A__		)

			return total.denominator + total.numerator


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



