
'''simple docstring'''





from __future__ import annotations







def snake_case_    (				lowercase__      ,					lowercase__      ,					lowercase__		):
  assert (
      c % greatest_common_divisor(lowercase__      ,					lowercase__		) == 0
  )  # greatest_common_divisor(a,b) function implemented below
  ((UpperCAmelCase__)					, (UpperCAmelCase__)					, (UpperCAmelCase__))			:				Dict												=       extended_gcd(lowercase__      ,					lowercase__		)  # extended_gcd(a,b) function implemented below
  UpperCAmelCase__			:				List[Any]												=       c / d
  return (r * x, r * y)







def snake_case_    (				lowercase__      ,					lowercase__      ,					lowercase__      ,					lowercase__ = 2		):
  ((UpperCAmelCase__)					, (UpperCAmelCase__))			:				Optional[int]												=       diophantine(lowercase__      ,					lowercase__      ,					lowercase__		)  # Initial value
  UpperCAmelCase__			:				Tuple												=       greatest_common_divisor(lowercase__      ,					lowercase__		)
  UpperCAmelCase__			:				str												=       a // d
  UpperCAmelCase__			:				List[str]												=       b // d

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







def snake_case_    (				lowercase__      ,					lowercase__		):
  if a < b:
    UpperCAmelCase__					, UpperCAmelCase__			:				Any												=       b, a

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

  return b







def snake_case_    (				lowercase__      ,					lowercase__		):
  assert a >= 0 and b >= 0

  if b == 0:
    UpperCAmelCase__					, UpperCAmelCase__					, UpperCAmelCase__			:				List[str]												=       a, 1, 0
  else:
    ((UpperCAmelCase__)					, (UpperCAmelCase__)					, (UpperCAmelCase__))			:				int												=       extended_gcd(lowercase__      ,					a % b		)
    UpperCAmelCase__			:				Union[str, Any]												=       q
    UpperCAmelCase__			:				Union[str, 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 doctest import testmod
from math import sqrt







def snake_case_    (				lowercase__		):
  UpperCAmelCase__			:				list[int]												=       []
  if num < 1:
    return facs
  facs.append(1		)
  if num == 1:
    return facs
  facs.append(lowercase__		)
  for i in range(2      ,					int(sqrt(lowercase__		)		) + 1		):
    if num % i == 0:  # If i is a factor of num
      facs.append(lowercase__		)
      UpperCAmelCase__			:				Tuple												=       num // i  # num//i is the other factor of num
      if d != i:  # If d and i are distinct
        facs.append(lowercase__		)  # we have found another factor
  facs.sort()
  return facs


if __name__ == "__main__":
      testmod(name="""factors_of_a_number""", verbose=True)



