
'''simple docstring'''



from __future__ import annotations

import sys





def  _A		(							lowercase__		,		lowercase__	):
						# base cases
						if abs(lowercase__	) == 1:
												return a, 0
						elif abs(lowercase__	) == 1:
												return 0, b

						lowercase__ ,						lowercase__							 =       a, b
						lowercase__ ,						lowercase__							 =       1, 0
						lowercase__ ,						lowercase__							 =       0, 1

						while remainder != 0:
												lowercase__							 =       old_remainder // remainder
												lowercase__ ,						lowercase__							 =       remainder, old_remainder - quotient * remainder
												lowercase__ ,						lowercase__							 =       coeff_a, old_coeff_a - quotient * coeff_a
												lowercase__ ,						lowercase__							 =       coeff_b, old_coeff_b - quotient * coeff_b

						# sign correction for negative numbers
						if a < 0:
												lowercase__							 =       -old_coeff_a
						if b < 0:
												lowercase__							 =       -old_coeff_b

						return old_coeff_a, old_coeff_b





def  _A		(							):
						if len(sys.argv	) < 3:
												print("""2 integer arguments required"""	)
												return 1
						lowercase__							 =       int(sys.argv[1]	)
						lowercase__							 =       int(sys.argv[2]	)
						print(extended_euclidean_algorithm(lowercase__		,		lowercase__	)	)
						return 0


if __name__ == "__main__":
				raise SystemExit(main())








'''simple docstring'''



def  _A		(							lowercase__	):

						# validate:
						if not isinstance(lowercase__		,		lowercase__	) or not all(
						    isinstance(lowercase__		,		lowercase__	) and item >= 0 for item in citations	):
												raise ValueError("""The citations should be a list of non negative integers."""	)

						citations.sort()
						lowercase__							 =       len(lowercase__	)

						for i in range(lowercase__	):
												if citations[len_citations - 1 - i] <= i:
																		return i

						return len_citations


if __name__ == "__main__":
				import doctest

				doctest.testmod()






