



"""simple docstring"""
from __future__ import annotations

import sys
def   A_    (     _lowercase,   _lowercase      ):







						'''simple docstring'''


						if abs(_lowercase      ) == 1:
												return a, 0
						elif abs(_lowercase      ) == 1:
												return 0, b

						snake_case_,			snake_case_					:Optional[int]		=     a, b
						snake_case_,			snake_case_					:List[Any]		=     1, 0
						snake_case_,			snake_case_					:Optional[int]		=     0, 1

						while remainder != 0:
												snake_case_					:Tuple		=     old_remainder // remainder
												snake_case_,			snake_case_					:List[Any]		=     remainder, old_remainder - quotient * remainder
												snake_case_,			snake_case_					:Union[str, Any]		=     coeff_a, old_coeff_a - quotient * coeff_a
												snake_case_,			snake_case_					:Union[str, Any]		=     coeff_b, old_coeff_b - quotient * coeff_b

						# sign correction for negative numbers
						if a < 0:
												snake_case_					:Optional[Any]		=     -old_coeff_a
						if b < 0:
												snake_case_					:Dict		=     -old_coeff_b

						return old_coeff_a, old_coeff_b
def   A_    (     ):







						'''simple docstring'''


						if len(sys.argv      ) < 3:
												print("""2 integer arguments required"""      )
												return 1
						snake_case_					:Dict		=     int(sys.argv[1]      )
						snake_case_					:Tuple		=     int(sys.argv[2]      )
						print(extended_euclidean_algorithm(_lowercase,   _lowercase      )      )
						return 0


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





"""simple docstring"""
import doctest

import projectq
from projectq.ops import H, Measure
def   A_    (     _lowercase      ):







						'''simple docstring'''


						snake_case_					:Union[str, Any]		=     quantum_engine.allocate_qubit()
						H | qubit
						Measure | qubit
						return int(_lowercase      )


if __name__ == "__main__":
						doctest.testmod()

						# initialises a new quantum backend
						__a           =							projectq.MainEngine()

						# Generate a list of 10 random numbers
						__a           =							[get_random_number(quantum_engine) for _ in range(10)]

						# Flushes the quantum engine from memory
						quantum_engine.flush()

						print("Random numbers", random_numbers_list)
