





'''simple docstring'''






import math
def 				_lowerCamelCase(	UpperCamelCase__     :			int		)		->	list:







    if n <= 0:
        raise ValueError('''Only positive integers have prime factors'''		)
    A							:							str				=    []
    while n % 2 == 0:
        pf.append(2		)
        A							:							List[str]				=    int(n / 2		)
    for i in range(3     ,							int(math.sqrt(UpperCamelCase_		)		) + 1     ,							2		):
        while n % i == 0:
            pf.append(UpperCamelCase_		)
            A							:							Union[str, Any]				=    int(n / i		)
    if n > 2:
        pf.append(UpperCamelCase_		)
    return pf
def 				_lowerCamelCase(	UpperCamelCase__     :			int		)		->	int:







    if n <= 0:
        raise ValueError('''Only positive numbers are accepted'''		)
    A							:							Optional[int]				=    1
    A							:							Optional[Any]				=    1
    while n % 2 == 0:
        temp += 1
        A							:							Union[str, Any]				=    int(n / 2		)
    div *= temp
    for i in range(3     ,							int(math.sqrt(UpperCamelCase_		)		) + 1     ,							2		):
        A							:							List[str]				=    1
        while n % i == 0:
            temp += 1
            A							:							str				=    int(n / i		)
        div *= temp
    if n > 1:
        div *= 2
    return div
def 				_lowerCamelCase(	UpperCamelCase__     :			int		)		->	int:







    if n <= 0:
        raise ValueError('''Only positive numbers are accepted'''		)
    A							:							Any				=    1
    A							:							Dict				=    1
    while n % 2 == 0:
        temp += 1
        A							:							Union[str, Any]				=    int(n / 2		)
    if temp > 1:
        s *= (2**temp - 1) / (2 - 1)
    for i in range(3     ,							int(math.sqrt(UpperCamelCase_		)		) + 1     ,							2		):
        A							:							int				=    1
        while n % i == 0:
            temp += 1
            A							:							Optional[Any]				=    int(n / i		)
        if temp > 1:
            s *= (i**temp - 1) / (i - 1)
    return int(UpperCamelCase_		)
def 				_lowerCamelCase(	UpperCamelCase__     :			int		)		->	int:
    A							:							Tuple				=    n
    for x in set(prime_factors(UpperCamelCase_		)		):
        s *= (x - 1) / x
    return int(UpperCamelCase_		)


if __name__ == "__main__":
     import doctest

     doctest.testmod()








"""simple docstring"""




from __future__ import annotations






def 							lowerCAmelCase			(   UpperCamelCase_:				int  ,			UpperCamelCase_:				int  ,			UpperCamelCase_:				int       )							->				tuple[float, float]:







  '''simple docstring'''







  assert (
      c % greatest_common_divisor(UpperCamelCase_  ,			UpperCamelCase_       ) == 0
  )  # greatest_common_divisor(a,b) function implemented below
  ((_a)      ,						(_a)      ,						(_a))					      =						extended_gcd(UpperCamelCase_  ,			UpperCamelCase_       )  # extended_gcd(a,b) function implemented below
  _a					      =						c / d
  return (r * x, r * y)






def 							lowerCAmelCase			(   UpperCamelCase_:				int  ,			UpperCamelCase_:				int  ,			UpperCamelCase_:				int  ,			UpperCamelCase_:				int = 2       )							->				None:







  '''simple docstring'''







  ((_a)      ,						(_a))					      =						diophantine(UpperCamelCase_  ,			UpperCamelCase_  ,			UpperCamelCase_       )  # Initial value
  _a					      =						greatest_common_divisor(UpperCamelCase_  ,			UpperCamelCase_       )
  _a					      =						a // d
  _a					      =						b // d

  for i in range(UpperCamelCase_       ):
    _a					      =						xa + i * q
    _a					      =						ya - i * p
    print(UpperCamelCase_  ,			UpperCamelCase_       )






def 							lowerCAmelCase			(   UpperCamelCase_:				int  ,			UpperCamelCase_:				int       )							->				int:







  '''simple docstring'''







  if a < b:
    _a      ,						_a					      =						b, a

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

  return b






def 							lowerCAmelCase			(   UpperCamelCase_:				int  ,			UpperCamelCase_:				int       )							->				tuple[int, int, int]:







  '''simple docstring'''







  assert a >= 0 and b >= 0

  if b == 0:
    _a      ,						_a      ,						_a					      =						a, 1, 0
  else:
    ((_a)      ,						(_a)      ,						(_a))					      =						extended_gcd(UpperCamelCase_  ,			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)


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)


