
"""simple docstring"""






from __future__ import annotations

from fractions import Fraction
from math import gcd, sqrt




def __magic_name__	(				_lowerCamelCase:		int			)					->						bool:

	'''simple docstring'''




	lowerCAmelCase												=  int(number**0.5			)
	return number == sq * sq




def __magic_name__	(				_lowerCamelCase:		int,					_lowerCamelCase:		int,					_lowerCamelCase:		int,					_lowerCamelCase:		int,					_lowerCamelCase:		int,					_lowerCamelCase:		int			)					->						tuple[int, int]:

	'''simple docstring'''




	lowerCAmelCase												=  x_num * y_den * z_den + y_num * x_den * z_den + z_num * x_den * y_den
	lowerCAmelCase												=  x_den * y_den * z_den
	lowerCAmelCase												=  gcd(_lowerCamelCase,					_lowerCamelCase			)
	top //= hcf
	bottom //= hcf
	return top, bottom




def __magic_name__	(				_lowerCamelCase:		int = 35			)					->						int:

	'''simple docstring'''




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

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

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

					# n=2
					lowerCAmelCase												=  x_num * x_num * y_num * y_num
					lowerCAmelCase												=  (
					    x_den * x_den * y_num * y_num + x_num * x_num * y_den * y_den
					)
					if is_sq(_lowerCamelCase			) and is_sq(_lowerCamelCase			):
						lowerCAmelCase												=  int(sqrt(_lowerCamelCase			)			)
						lowerCAmelCase												=  int(sqrt(_lowerCamelCase			)			)
						lowerCAmelCase												=  gcd(_lowerCamelCase,					_lowerCamelCase			)
						z_num //= hcf
						z_den //= hcf
						if 0 < z_num < z_den <= order:
							lowerCAmelCase												=  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"""






import timeit

import numpy as np

import datasets
from datasets.arrow_writer import ArrowWriter
from datasets.features.features import _ArrayXD




def __magic_name__	(				_lowerCamelCase:		Optional[Any]			)					->						Dict:

	'''simple docstring'''




	def wrapper(*_lowerCamelCase:		Any,					**_lowerCamelCase:		Union[str, Any]			):
		lowerCAmelCase												=  timeit.default_timer()
		lowerCAmelCase												=  func(*_lowerCamelCase,					**_lowerCamelCase			)
		lowerCAmelCase												=  timeit.default_timer() - starttime
		return delta

	lowerCAmelCase												=  func.__name__

	return wrapper




def __magic_name__	(				_lowerCamelCase:		dict,					_lowerCamelCase:		List[Any]=100,					_lowerCamelCase:		int=None			)					->						List[Any]:

	'''simple docstring'''




	lowerCAmelCase												=  []
	lowerCAmelCase												=  seq_shapes or {}
	for i in range(_lowerCamelCase			):
		lowerCAmelCase												=  {}
		for col_id, (k, v) in enumerate(features.items()			):
			if isinstance(_lowerCamelCase,					_ArrayXD			):
				lowerCAmelCase												=  np.random.rand(*v.shape			).astype(v.dtype			)
			elif isinstance(_lowerCamelCase,					datasets.Value			):
				if v.dtype == "string":
					lowerCAmelCase												=  '''The small grey turtle was surprisingly fast when challenged.'''
				else:
					lowerCAmelCase												=  np.random.randint(10,					size=1			).astype(v.dtype			).item()
			elif isinstance(_lowerCamelCase,					datasets.Sequence			):
				while isinstance(_lowerCamelCase,					datasets.Sequence			):
					lowerCAmelCase												=  v.feature
				lowerCAmelCase												=  seq_shapes[k]
				lowerCAmelCase												=  np.random.rand(*_lowerCamelCase			).astype(v.dtype			)
			lowerCAmelCase												=  data

		dummy_data.append((i, example)			)

	return dummy_data




def __magic_name__	(				_lowerCamelCase:		Tuple,					_lowerCamelCase:		Tuple,					_lowerCamelCase:		Union[str, Any]=100,					_lowerCamelCase:		List[Any]=None			)					->						List[Any]:

	'''simple docstring'''




	lowerCAmelCase												=  generate_examples(_lowerCamelCase,					num_examples=_lowerCamelCase,					seq_shapes=_lowerCamelCase			)

	with ArrowWriter(features=_lowerCamelCase,					path=_lowerCamelCase			) as writer:
		for key, record in dummy_data:
			lowerCAmelCase												=  features.encode_example(_lowerCamelCase			)
			writer.write(_lowerCamelCase			)

		lowerCAmelCase							,       lowerCAmelCase												=  writer.finalize()

	if not num_final_examples == num_examples:
		raise ValueError(
		    F"""Error writing the dataset, wrote {num_final_examples} examples but should have written {num_examples}."""			)

	lowerCAmelCase												=  datasets.Dataset.from_file(filename=_lowerCamelCase,					info=datasets.DatasetInfo(features=_lowerCamelCase			)			)

	return dataset


