



import qiskit
from qiskit.providers import Backend







def    lowerCAmelCase_  (lowerCAmelCase__:		int		,	lowerCAmelCase__:		int     ):





			"""simple docstring"""


			UpperCAmelCase_			,       UpperCAmelCase_:		Optional[int]       			=					bin(__lowerCamelCase     )[2:], bin(__lowerCamelCase     )[2:]  # Remove leading '0b'

			# Ensure that both strings are of the same length
			if len(__lowerCamelCase     ) > len(__lowerCamelCase     ):
						UpperCAmelCase_:		Dict       			=					y.zfill(len(__lowerCamelCase     )     )
			else:
						UpperCAmelCase_:		Any       			=					x.zfill(len(__lowerCamelCase     )     )

			# We need (3 * number of bits in the larger number)+1 qBits
			# The second parameter is the number of classical registers, to measure the result
			UpperCAmelCase_:		Any       			=					qiskit.QuantumCircuit((len(__lowerCamelCase     ) * 3) + 1		,	len(__lowerCamelCase     ) + 1     )

			# We are essentially "not-ing" the bits that are 1
			# Reversed because it's easier to perform ops on more significant bits
			for i in range(len(__lowerCamelCase     )     ):
						if x[::-1][i] == "1":
									circuit.x(__lowerCamelCase     )
			for j in range(len(__lowerCamelCase     )     ):
						if y[::-1][j] == "1":
									circuit.x(len(__lowerCamelCase     ) + j     )

			return circuit, x, y







def    lowerCAmelCase_  (lowerCAmelCase__:		qiskit.QuantumCircuit		,	lowerCAmelCase__:		int		,	lowerCAmelCase__:		int		,	lowerCAmelCase__:		int		,	lowerCAmelCase__:		int		,	):





			"""simple docstring"""


			circuit.ccx(__lowerCamelCase		,	__lowerCamelCase		,	__lowerCamelCase     )
			circuit.cx(__lowerCamelCase		,	__lowerCamelCase     )
			circuit.ccx(__lowerCamelCase		,	__lowerCamelCase		,	__lowerCamelCase     )
			circuit.cx(__lowerCamelCase		,	__lowerCamelCase     )
			circuit.cx(__lowerCamelCase		,	__lowerCamelCase     )







def    lowerCAmelCase_  (lowerCAmelCase__:		int		,	lowerCAmelCase__:		int		,	lowerCAmelCase__:		Backend = qiskit.Aer.get_backend("""aer_simulator"""     )		,	):





			"""simple docstring"""


			if vala < 0 or vala < 0:
						raise ValueError("""Both Integers must be positive!"""     )

			# Store the Integers
			UpperCAmelCase_			,       UpperCAmelCase_			,       UpperCAmelCase_:		Union[str, Any]       			=					store_two_classics(__lowerCamelCase		,	__lowerCamelCase     )
			for i in range(len(__lowerCamelCase     )     ):
						full_adder(__lowerCamelCase		,	__lowerCamelCase		,	len(__lowerCamelCase     ) + i		,	len(__lowerCamelCase     ) + len(__lowerCamelCase     ) + i		,	len(__lowerCamelCase     ) + len(__lowerCamelCase     ) + i + 1     )
						circuit.barrier()  # Optional, just for aesthetics

			# Measure the resultant qBits
			for i in range(len(__lowerCamelCase     ) + 1     ):
						circuit.measure([(len(__lowerCamelCase     ) * 2) + i]		,	[i]     )

			UpperCAmelCase_:		Optional[Any]       			=					qiskit.execute(__lowerCamelCase		,	__lowerCamelCase		,	shots=1     ).result()

			# The result is in binary. Convert it back to int
			return int(list(res.get_counts()     )[0]		,	2     )


if __name__ == "__main__":
	import doctest

	doctest.testmod()











import decimal







def    lowerCAmelCase_  ():





			"""simple docstring"""


			UpperCAmelCase_:		Union[str, Any]       			=    0
			UpperCAmelCase_:		Optional[Any]       			=    decimal.Context(prec=1_0_5     )
			for i in range(2		,	1_0_0     ):
						UpperCAmelCase_:		str       			=    decimal.Decimal(lowerCAmelCase__     )
						UpperCAmelCase_:		Any       			=    number.sqrt(lowerCAmelCase__     )
						if len(str(lowerCAmelCase__     )     ) > 1:
									answer += int(str(lowerCAmelCase__     )[0]     )
									UpperCAmelCase_:		str       			=    str(lowerCAmelCase__     )[2:1_0_1]
									answer += sum(int(lowerCAmelCase__     ) for x in sqrt_number_str     )
			return answer


if __name__ == "__main__":
	import doctest

	doctest.testmod()
	print(F'''{solution() = }''')






