'''simple docstring'''




from __future__ import annotations

from fractions import Fraction
from math import gcd, sqrt

def 	UpperCamelCase_							(					_UpperCAmelCase  :      int    )    ->    bool:


       """simple docstring"""







       _UpperCAmelCase     :  int							      =    int(number**0.5    )
       return number == sq * sq

def 	UpperCamelCase_							(					_UpperCAmelCase  :      int			,	_UpperCAmelCase  :      int			,	_UpperCAmelCase  :      int			,	_UpperCAmelCase  :      int			,	_UpperCAmelCase  :      int			,	_UpperCAmelCase  :      int    )    ->    tuple[int, int]:


       """simple docstring"""







       _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(_UpperCAmelCase			,	_UpperCAmelCase    )
       top //= hcf
       bottom //= hcf
       return top, bottom

def 	UpperCamelCase_							(					_UpperCAmelCase  :      int = 35    )    ->    int:


       """simple docstring"""







       _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     :  Dict							      =    x_num * y_den + x_den * y_num
                                   _UpperCAmelCase     :  Any							      =    x_den * y_den
                                   _UpperCAmelCase     :  List[str]							      =    gcd(_UpperCAmelCase			,	_UpperCAmelCase    )
                                   z_num //= hcf
                                   z_den //= hcf
                                   if 0 < z_num < z_den <= order:
                                          _UpperCAmelCase     :  Optional[Any]							      =    add_three(
                                              _UpperCAmelCase			,	_UpperCAmelCase			,	_UpperCAmelCase			,	_UpperCAmelCase			,	_UpperCAmelCase			,	_UpperCAmelCase    )
                                          unique_s.add(_UpperCAmelCase    )

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

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

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

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

       return total.denominator + total.numerator


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


'''simple docstring'''




__SCREAMING_SNAKE_CASE       :     Dict     =  8.3_1_4_4_6_2  # Unit - J mol-1 K-1

def 	UpperCamelCase_							(					_UpperCAmelCase  :      float			,	_UpperCAmelCase  :      float			,	_UpperCAmelCase  :      float    )    ->    float:


       """simple docstring"""







       if moles < 0 or kelvin < 0 or volume < 0:
              raise ValueError("Invalid inputs. Enter positive value."    )
       return moles * kelvin * UNIVERSAL_GAS_CONSTANT / volume

def 	UpperCamelCase_							(					_UpperCAmelCase  :      float			,	_UpperCAmelCase  :      float			,	_UpperCAmelCase  :      float    )    ->    float:


       """simple docstring"""







       if moles < 0 or kelvin < 0 or pressure < 0:
              raise ValueError("Invalid inputs. Enter positive value."    )
       return moles * kelvin * UNIVERSAL_GAS_CONSTANT / pressure


if __name__ == "__main__":
  from doctest import testmod

  testmod()

