
"""simple docstring"""




from decimal import Decimal, getcontext
from math import ceil, factorial


def     __magic_name__      ( __snake_case							:			int    )					->							str:

       if not isinstance(__snake_case	,					__snake_case    ):
              raise TypeError("Undefined for non-integers"    )
       elif precision < 1:
              raise ValueError("Undefined for non-natural numbers"    )

       lowercase       :							List[str]									=				precision
       lowercase       :							Any									=				ceil(precision / 14    )
       lowercase       :							Optional[Any]									=				42_6880 * Decimal(1_0005    ).sqrt()
       lowercase       :							Tuple									=				1
       lowercase       :							Tuple									=				1359_1409
       lowercase       :							List[Any]									=				Decimal(__snake_case    )
       for k in range(1	,					__snake_case    ):
              lowercase       :							Optional[Any]									=				factorial(6 * k    ) // (factorial(3 * k    ) * factorial(__snake_case    ) ** 3)
              linear_term += 5_4514_0134
              exponential_term *= -26_2537_4126_4076_8000
              partial_sum += Decimal(multinomial_term * linear_term    ) / exponential_term
       return str(constant_term / partial_sum    )[:-1]


if __name__ == "__main__":
   _A     :			Tuple  						=			50
   print(F"The first {n} digits of pi is: {pi(n)}")




"""simple docstring"""




from __future__ import annotations

from math import pow, sqrt


def     __magic_name__      ( __snake_case							:			float	,					__snake_case							:			float	,					__snake_case							:			float    )					->							dict[str, float]:
       if (resistance, reactance, impedance).count(0    ) != 1:
              raise ValueError("One and only one argument must be 0"    )
       if resistance == 0:
              return {"resistance": sqrt(pow(__snake_case	,					2    ) - pow(__snake_case	,					2    )    )}
       elif reactance == 0:
              return {"reactance": sqrt(pow(__snake_case	,					2    ) - pow(__snake_case	,					2    )    )}
       elif impedance == 0:
              return {"impedance": sqrt(pow(__snake_case	,					2    ) + pow(__snake_case	,					2    )    )}
       else:
              raise ValueError("Exactly one argument must be 0"    )


if __name__ == "__main__":
   import doctest

   doctest.testmod()


