


"""simple docstring"""






from __future__ import annotations

from fractions import Fraction
from math import gcd, sqrt
def       A_   (   _lowerCAmelCase     :					int       ):






     """simple docstring"""

     _a    	=				int(number**0.5       )
     return number == sq * sq
def       A_   (   _lowerCAmelCase     :					int,     _lowerCAmelCase     :					int,     _lowerCAmelCase     :					int,     _lowerCAmelCase     :					int,     _lowerCAmelCase     :					int,     _lowerCAmelCase     :					int       ):






     """simple docstring"""

     _a    	=				x_num * y_den * z_den + y_num * x_den * z_den + z_num * x_den * y_den
     _a    	=				x_den * y_den * z_den
     _a    	=				gcd(_lowerCAmelCase,     _lowerCAmelCase       )
     top //= hcf
     bottom //= hcf
     return top, bottom
def       A_   (   _lowerCAmelCase     :					int = 35       ):






     """simple docstring"""

     _a    	=				set()
     _a    	=				42
     _a    	=				Fraction(0       )
     _a    	=				42

     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    	=				x_num * y_den + x_den * y_num
                         _a    	=				x_den * y_den
                         _a    	=				gcd(_lowerCAmelCase,     _lowerCAmelCase       )
                         z_num //= hcf
                         z_den //= hcf
                         if 0 < z_num < z_den <= order:
                              _a    	=				add_three(
                                  _lowerCAmelCase,     _lowerCAmelCase,     _lowerCAmelCase,     _lowerCAmelCase,     _lowerCAmelCase,     _lowerCAmelCase       )
                              unique_s.add(_lowerCAmelCase       )

                         # n=2
                         _a    	=				(
                             x_num * x_num * y_den * y_den + x_den * x_den * y_num * y_num
                         )
                         _a    	=				x_den * x_den * y_den * y_den
                         if is_sq(_lowerCAmelCase       ) and is_sq(_lowerCAmelCase       ):
                              _a    	=				int(sqrt(_lowerCAmelCase       )       )
                              _a    	=				int(sqrt(_lowerCAmelCase       )       )
                              _a    	=				gcd(_lowerCAmelCase,     _lowerCAmelCase       )
                              z_num //= hcf
                              z_den //= hcf
                              if 0 < z_num < z_den <= order:
                                   _a    	=				add_three(
                                       _lowerCAmelCase,     _lowerCAmelCase,     _lowerCAmelCase,     _lowerCAmelCase,     _lowerCAmelCase,     _lowerCAmelCase       )
                                   unique_s.add(_lowerCAmelCase       )

                    # n=-1
                         _a    	=				x_num * y_num
                         _a    	=				x_den * y_num + x_num * y_den
                         _a    	=				gcd(_lowerCAmelCase,     _lowerCAmelCase       )
                         z_num //= hcf
                         z_den //= hcf
                         if 0 < z_num < z_den <= order:
                              _a    	=				add_three(
                                  _lowerCAmelCase,     _lowerCAmelCase,     _lowerCAmelCase,     _lowerCAmelCase,     _lowerCAmelCase,     _lowerCAmelCase       )
                              unique_s.add(_lowerCAmelCase       )

                         # n=2
                         _a    	=				x_num * x_num * y_num * y_num
                         _a    	=				(
                             x_den * x_den * y_num * y_num + x_num * x_num * y_den * y_den
                         )
                         if is_sq(_lowerCAmelCase       ) and is_sq(_lowerCAmelCase       ):
                              _a    	=				int(sqrt(_lowerCAmelCase       )       )
                              _a    	=				int(sqrt(_lowerCAmelCase       )       )
                              _a    	=				gcd(_lowerCAmelCase,     _lowerCAmelCase       )
                              z_num //= hcf
                              z_den //= hcf
                              if 0 < z_num < z_den <= order:
                                   _a    	=				add_three(
                                       _lowerCAmelCase,     _lowerCAmelCase,     _lowerCAmelCase,     _lowerCAmelCase,     _lowerCAmelCase,     _lowerCAmelCase       )
                                   unique_s.add(_lowerCAmelCase       )

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

     return total.denominator + total.numerator


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



"""simple docstring"""






from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_tf_available,
    is_tokenizers_available,
    is_torch_available,
)


__snake_case		=       {
    '''configuration_lxmert''': ['''LXMERT_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''LxmertConfig'''],
    '''tokenization_lxmert''': ['''LxmertTokenizer'''],
}

try:
   if not is_tokenizers_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   __snake_case		=       ['''LxmertTokenizerFast''']

try:
   if not is_torch_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   __snake_case		=       [
       '''LxmertEncoder''',
       '''LxmertForPreTraining''',
       '''LxmertForQuestionAnswering''',
       '''LxmertModel''',
       '''LxmertPreTrainedModel''',
       '''LxmertVisualFeatureEncoder''',
       '''LxmertXLayer''',
   ]

try:
   if not is_tf_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   __snake_case		=       [
       '''TF_LXMERT_PRETRAINED_MODEL_ARCHIVE_LIST''',
       '''TFLxmertForPreTraining''',
       '''TFLxmertMainLayer''',
       '''TFLxmertModel''',
       '''TFLxmertPreTrainedModel''',
       '''TFLxmertVisualFeatureEncoder''',
   ]


if TYPE_CHECKING:
   from .configuration_lxmert import LXMERT_PRETRAINED_CONFIG_ARCHIVE_MAP, LxmertConfig
   from .tokenization_lxmert import LxmertTokenizer

   try:
      if not is_tokenizers_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .tokenization_lxmert_fast import LxmertTokenizerFast

   try:
      if not is_torch_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .modeling_lxmert import (
          LxmertEncoder,
          LxmertForPreTraining,
          LxmertForQuestionAnswering,
          LxmertModel,
          LxmertPreTrainedModel,
          LxmertVisualFeatureEncoder,
          LxmertXLayer,
      )

   try:
      if not is_tf_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .modeling_tf_lxmert import (
          TF_LXMERT_PRETRAINED_MODEL_ARCHIVE_LIST,
          TFLxmertForPreTraining,
          TFLxmertMainLayer,
          TFLxmertModel,
          TFLxmertPreTrainedModel,
          TFLxmertVisualFeatureEncoder,
      )

else:
   import sys

   __snake_case		=       _LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)