





from __future__ import annotations

from fractions import Fraction
from math import gcd, sqrt
def      _A       (		SCREAMING_SNAKE_CASE     :   int						):





  """simple docstring"""



  a__	:					int										=int(number**0.5						)
  return number == sq * sq
def      _A       (		SCREAMING_SNAKE_CASE     :   int       ,       SCREAMING_SNAKE_CASE     :   int       ,       SCREAMING_SNAKE_CASE     :   int       ,       SCREAMING_SNAKE_CASE     :   int       ,       SCREAMING_SNAKE_CASE     :   int       ,       SCREAMING_SNAKE_CASE     :   int						):





  """simple docstring"""



  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      _A       (		SCREAMING_SNAKE_CASE     :   int = 35						):





  """simple docstring"""



  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__	:					Optional[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__	:					List[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__	:					List[str]										=(
              x_num * x_num * y_den * y_den + x_den * x_den * y_num * y_num
          )
          a__	:					int										=x_den * x_den * y_den * y_den
          if is_sq(SCREAMING_SNAKE_CASE						) and is_sq(SCREAMING_SNAKE_CASE						):
            a__	:					Optional[int]										=int(sqrt(SCREAMING_SNAKE_CASE						)						)
            a__	:					List[str]										=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__	:					List[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__	:					List[str]										=x_num * y_num
          a__	:					Dict										=x_den * y_num + x_num * y_den
          a__	:					Tuple										=gcd(SCREAMING_SNAKE_CASE       ,       SCREAMING_SNAKE_CASE						)
          z_num //= hcf
          z_den //= hcf
          if 0 < z_num < z_den <= order:
            a__	:					Dict										=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__	:					List[str]										=x_num * x_num * y_num * y_num
          a__	:					Optional[int]										=(
              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__	:					List[Any]										=int(sqrt(SCREAMING_SNAKE_CASE						)						)
            a__	:					Optional[Any]										=int(sqrt(SCREAMING_SNAKE_CASE						)						)
            a__	:					List[Any]										=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						)

  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() = }""")













def      _A       (		SCREAMING_SNAKE_CASE     :   list						):





  """simple docstring"""



  if not isinstance(SCREAMING_SNAKE_CASE       ,       SCREAMING_SNAKE_CASE						):
    raise ValueError("Input series is not valid, valid series - [2, 4, 6]"						)
  if len(SCREAMING_SNAKE_CASE						) == 0:
    raise ValueError("Input list must be a non empty list"						)
  if len(SCREAMING_SNAKE_CASE						) == 1:
    return True
  a__	:					Union[str, Any]										=series[1] - series[0]
  for index in range(len(SCREAMING_SNAKE_CASE						) - 1						):
    if series[index + 1] - series[index] != common_diff:
      return False
  return True
def      _A       (		SCREAMING_SNAKE_CASE     :   list						):





  """simple docstring"""



  if not isinstance(SCREAMING_SNAKE_CASE       ,       SCREAMING_SNAKE_CASE						):
    raise ValueError("Input series is not valid, valid series - [2, 4, 6]"						)
  if len(SCREAMING_SNAKE_CASE						) == 0:
    raise ValueError("Input list must be a non empty list"						)
  a__	:					Any										=0
  for val in series:
    answer += val
  return answer / len(SCREAMING_SNAKE_CASE						)


if __name__ == "__main__":
     import doctest

     doctest.testmod()






