






"""simple docstring"""



from __future__ import annotations


def      SCREAMING_SNAKE_CASE__    (   snake_case    :      Optional[int]       , snake_case    :      List[Any]       , snake_case    :      Tuple							)->						Optional[int]:






     '''simple docstring'''



     assert (
         c % greatest_common_divisor(lowerCAmelCase_       , lowerCAmelCase_							) == 0
     )  # greatest_common_divisor(a,b) function implemented below
     (UpperCAmelCase__)		:  Any				=				extended_gcd(lowerCAmelCase_       , lowerCAmelCase_							)  # extended_gcd(a,b) function implemented below
     UpperCAmelCase__		:  Any				=				c / d
     return (r * x, r * y)


def      SCREAMING_SNAKE_CASE__    (   snake_case    :      str       , snake_case    :      Optional[int]       , snake_case    :      Any       , snake_case    :      Dict = 2							)->						List[str]:






     '''simple docstring'''



     (UpperCAmelCase__)		:  Any				=				diophantine(lowerCAmelCase_       , lowerCAmelCase_       , lowerCAmelCase_							)  # Initial value
     UpperCAmelCase__		:  List[Any]				=				greatest_common_divisor(lowerCAmelCase_       , lowerCAmelCase_							)
     UpperCAmelCase__		:  Optional[Any]				=				a // d
     UpperCAmelCase__		:  Any				=				b // d

     for i in range(lowerCAmelCase_							):
          UpperCAmelCase__		:  List[Any]				=				xa + i * q
          UpperCAmelCase__		:  Any				=				ya - i * p
          print(lowerCAmelCase_       , lowerCAmelCase_							)


def      SCREAMING_SNAKE_CASE__    (   snake_case    :      Any       , snake_case    :      Optional[Any]							)->						List[Any]:






     '''simple docstring'''



     if a < b:
          UpperCAmelCase__		:  Any				=				b, a

     while a % b != 0:
          UpperCAmelCase__		:  Dict				=				b, a % b

     return b


def      SCREAMING_SNAKE_CASE__    (   snake_case    :      str       , snake_case    :      Dict							)->						str:






     '''simple docstring'''



     assert a >= 0 and b >= 0

     if b == 0:
          UpperCAmelCase__		:  Union[str, Any]				=				a, 1, 0
     else:
          (UpperCAmelCase__)		:  List[Any]				=				extended_gcd(lowerCAmelCase_       , a % b							)
          UpperCAmelCase__		:  Optional[int]				=				q
          UpperCAmelCase__		:  Optional[Any]				=				p - q * (a // b)

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

     return (d, x, y)


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

 testmod(name="""diophantine""", verbose=True)
 testmod(name="""diophantine_all_soln""", verbose=True)
 testmod(name="""extended_gcd""", verbose=True)
 testmod(name="""greatest_common_divisor""", verbose=True)




'''simple docstring'''

from itertools import combinations, product







def __A  (    lowerCAmelCase_ ,       lowerCAmelCase_ ,       lowerCAmelCase_ ,       lowerCAmelCase_       ):
     if xa == ya == 0 or xa == ya == 0:
          return False
     _UpperCAmelCase					:  Any         =    xa * xa + ya * ya
     _UpperCAmelCase					:  Any         =    xa * xa + ya * ya
     _UpperCAmelCase					:  Tuple         =    (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 __A  (    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() = }")


