




'''simple docstring'''


from __future__ import annotations

from fractions import Fraction
from math import gcd, sqrt
def  SCREAMING_SNAKE_CASE(					__lowercase     )       ->      bool:
     A:						int						=						int(number**0.5     )
     return number == sq * sq
def  SCREAMING_SNAKE_CASE(					__lowercase						,							__lowercase						,							__lowercase						,							__lowercase						,							__lowercase						,							__lowercase     )       ->      tuple[int, int]:
     A:						int						=						x_num * y_den * z_den + y_num * x_den * z_den + z_num * x_den * y_den
     A:						int						=						x_den * y_den * z_den
     A:						int						=						gcd(_SCREAMING_SNAKE_CASE						,							_SCREAMING_SNAKE_CASE     )
     top //= hcf
     bottom //= hcf
     return top, bottom
def  SCREAMING_SNAKE_CASE(					__lowercase = 3_5     )       ->      int:
     A:						set						=						set()
     A:						int
     A:						Fraction						=						Fraction(0     )
     A:						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
                         A:						Dict						=						x_num * y_den + x_den * y_num
                         A:						Any						=						x_den * y_den
                         A:						int						=						gcd(_SCREAMING_SNAKE_CASE						,							_SCREAMING_SNAKE_CASE     )
                         z_num //= hcf
                         z_den //= hcf
                         if 0 < z_num < z_den <= order:
                              A:						Tuple						=						add_three(
                                  _SCREAMING_SNAKE_CASE						,							_SCREAMING_SNAKE_CASE						,							_SCREAMING_SNAKE_CASE						,							_SCREAMING_SNAKE_CASE						,							_SCREAMING_SNAKE_CASE						,							_SCREAMING_SNAKE_CASE     )
                              unique_s.add(_SCREAMING_SNAKE_CASE     )

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

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

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

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

     return total.denominator + total.numerator


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












import math

def      A      (      _SCREAMING_SNAKE_CASE ,_SCREAMING_SNAKE_CASE    )	-> float:
       if (
           not isinstance(_SCREAMING_SNAKE_CASE ,(int, float)    )
           or power_factor < -1
           or power_factor > 1
       ):
              raise ValueError("power_factor must be a valid float value between -1 and 1."    )
       return apparent_power * power_factor

def      A      (      _SCREAMING_SNAKE_CASE ,_SCREAMING_SNAKE_CASE    )	-> float:
       if (
           not isinstance(_SCREAMING_SNAKE_CASE ,(int, float)    )
           or power_factor < -1
           or power_factor > 1
       ):
              raise ValueError("power_factor must be a valid float value between -1 and 1."    )
       return apparent_power * math.sqrt(1 - power_factor**2    )


if __name__ == "__main__":
       import doctest

       doctest.testmod()






