


'''simple docstring'''
from __future__ import annotations

from fractions import Fraction
from math import gcd, sqrt





def 					a__       (					lowerCAmelCase__						)    ->	bool:
    UpperCAmelCase__			:		int													=				int(number**0.5						)
    return number == sq * sq





def 					a__       (					lowerCAmelCase__  ,					lowerCAmelCase__  ,					lowerCAmelCase__  ,					lowerCAmelCase__  ,					lowerCAmelCase__  ,					lowerCAmelCase__						)    ->	tuple[int, int]:
    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(__SCREAMING_SNAKE_CASE  ,					__SCREAMING_SNAKE_CASE						)
    top //= hcf
    bottom //= hcf
    return top, bottom





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



"""simple docstring"""


from urllib.parse import quote

import pytest

from datasets.utils.hub import hf_hub_url






@pytest.mark.parametrize("repo_id"					, ["canonical_dataset_name", "org-name/dataset-name"] )
@pytest.mark.parametrize("path"					, ["filename.csv", "filename with blanks.csv"] )
@pytest.mark.parametrize("revision"					, [None, "v2"] )
def     a__    (    __SCREAMING_SNAKE_CASE					, __SCREAMING_SNAKE_CASE					, __SCREAMING_SNAKE_CASE )	->	List[str]:
		__lowerCAmelCase:       Optional[Any]          =			hf_hub_url(repo_id=__SCREAMING_SNAKE_CASE					, path=__SCREAMING_SNAKE_CASE					, revision=__SCREAMING_SNAKE_CASE )
		assert url == F"https://huggingface.co/datasets/{repo_id}/resolve/{revision or 'main'}/{quote(__SCREAMING_SNAKE_CASE )}"


