
"""simple docstring"""
def 					a__ ( a :					int		):

  """simple docstring"""







  if not isinstance(a							,  a		):
    _snake_case  :    Optional[Any]            = f'Input value of [number={number}] must be an integer'
    raise TypeError(a		)
  if number < 0 or number % 2 == 1:
    return False
  _snake_case  :    Dict            = int(number**0.5		)
  return number == number_sqrt * (number_sqrt + 1)


if __name__ == "__main__":
    import doctest

    doctest.testmod()






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


def 	lowercase_						( lowerCAmelCase__						:	int      ,				lowerCAmelCase__						:	int      ,				lowerCAmelCase__						:	int			):

			"""simple docstring"""





			assert (
			    c % greatest_common_divisor(lowerCAmelCase__      ,				lowerCAmelCase__			) == 0
			)  # greatest_common_divisor(a,b) function implemented below
			((__UpperCAmelCase)					,	(__UpperCAmelCase)					,	(__UpperCAmelCase)) :   int    					=  extended_gcd(lowerCAmelCase__      ,				lowerCAmelCase__			)  # extended_gcd(a,b) function implemented below
			__UpperCAmelCase :   Union[str, Any]    					=  c / d
			return (r * x, r * y)


def 	lowercase_						( lowerCAmelCase__						:	int      ,				lowerCAmelCase__						:	int      ,				lowerCAmelCase__						:	int      ,				lowerCAmelCase__						:	int = 2			):

			"""simple docstring"""





			((__UpperCAmelCase)					,	(__UpperCAmelCase)) :   List[str]    					=  diophantine(lowerCAmelCase__      ,				lowerCAmelCase__      ,				lowerCAmelCase__			)  # Initial value
			__UpperCAmelCase :   List[str]    					=  greatest_common_divisor(lowerCAmelCase__      ,				lowerCAmelCase__			)
			__UpperCAmelCase :   List[str]    					=  a // d
			__UpperCAmelCase :   Tuple    					=  b // d

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


def 	lowercase_						( lowerCAmelCase__						:	int      ,				lowerCAmelCase__						:	int			):

			"""simple docstring"""





			if a < b:
						__UpperCAmelCase					,	__UpperCAmelCase :   List[str]    					=  b, a

			while a % b != 0:
						__UpperCAmelCase					,	__UpperCAmelCase :   Optional[int]    					=  b, a % b

			return b


def 	lowercase_						( lowerCAmelCase__						:	int      ,				lowerCAmelCase__						:	int			):

			"""simple docstring"""





			assert a >= 0 and b >= 0

			if b == 0:
						__UpperCAmelCase					,	__UpperCAmelCase					,	__UpperCAmelCase :   List[str]    					=  a, 1, 0
			else:
						((__UpperCAmelCase)					,	(__UpperCAmelCase)					,	(__UpperCAmelCase)) :   str    					=  extended_gcd(lowerCAmelCase__      ,				a % b			)
						__UpperCAmelCase :   Optional[Any]    					=  q
						__UpperCAmelCase :   Dict    					=  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)




