






"""simple docstring"""







from __future__ import annotations





def 							SCREAMING_SNAKE_CASE							(   lowerCamelCase_			,  lowerCamelCase_			,  lowerCamelCase_):
					assert n > 1 and a > 0 and greatest_common_divisor(lowerCamelCase_			,  lowerCamelCase_) == 1
					((a__)							,(a__)							,(a__)) 							=	extended_gcd(lowerCamelCase_			,  lowerCamelCase_)  # Implemented below
					a__ 							=	(b * s) % n
					return x





def 							SCREAMING_SNAKE_CASE							(   lowerCamelCase_			,  lowerCamelCase_):
					((a__)							,(a__)) 							=	extended_euclid(lowerCamelCase_			,  lowerCamelCase_)  # Implemented below
					if b < 0:
										a__ 							=	(b % n + n) % n
					return b





def 							SCREAMING_SNAKE_CASE							(   lowerCamelCase_			,  lowerCamelCase_			,  lowerCamelCase_):
					a__ 							=	invert_modulo(lowerCamelCase_			,  lowerCamelCase_)
					a__ 							=	(b * s) % n
					return x





def 							SCREAMING_SNAKE_CASE							(   lowerCamelCase_			,  lowerCamelCase_):
					assert a >= 0 and b >= 0

					if b == 0:
										a__							,a__							,a__ 							=	a, 1, 0
					else:
										((a__)							,(a__)							,(a__)) 							=	extended_gcd(lowerCamelCase_			,  a % b)
										a__ 							=	q
										a__ 							=	p - q * (a // b)

					assert a % d == 0 and b % d == 0
					assert d == a * x + b * y

					return (d, x, y)





def 							SCREAMING_SNAKE_CASE							(   lowerCamelCase_			,  lowerCamelCase_):
					if b == 0:
										return (1, 0)
					((a__)							,(a__)) 							=	extended_euclid(lowerCamelCase_			,  a % b)
					a__ 							=	a // b
					return (y, x - k * y)





def 							SCREAMING_SNAKE_CASE							(   lowerCamelCase_			,  lowerCamelCase_):
					if a < b:
										a__							,a__ 							=	b, a

					while a % b != 0:
										a__							,a__ 							=	b, a % b

					return b


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

	testmod(name='modular_division', verbose=True)
	testmod(name='modular_division2', verbose=True)
	testmod(name='invert_modulo', verbose=True)
	testmod(name='extended_gcd', verbose=True)
	testmod(name='extended_euclid', verbose=True)
	testmod(name='greatest_common_divisor', verbose=True)










"""simple docstring"""







from itertools import combinations, product





def 							SCREAMING_SNAKE_CASE							(   lowerCamelCase_			,  lowerCamelCase_			,  lowerCamelCase_			,  lowerCamelCase_):
					if xa == ya == 0 or xa == ya == 0:
										return False
					a__ 							=	xa * xa + ya * ya
					a__ 							=	xa * xa + ya * ya
					a__ 							=	(xa - xa) * (xa - xa) + (ya - ya) * (ya - ya)
					return (
					    a_square + b_square == c_square
					    or a_square + c_square == b_square
					    or b_square + c_square == a_square
					)





def 							SCREAMING_SNAKE_CASE							(   lowerCamelCase_ = 50):
					return sum(
					    1
					    for pta, pta in combinations(product(range(limit + 1)			,  repeat=2)			,  2)
					    if is_right(*lowerCamelCase_			,  *lowerCamelCase_))


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


