






import math

import qiskit

def    UpperCamelCase						(	_A = 1,   _A = 1,   _A = 1			):






						"""simple docstring"""







						if (
						    isinstance(_lowerCAmelCase,   _lowerCAmelCase			)
						    or isinstance(_lowerCAmelCase,   _lowerCAmelCase			)
						    or isinstance(_lowerCAmelCase,   _lowerCAmelCase			)
						):
												raise TypeError("""inputs must be integers."""			)

						if (input_a < 0) or (input_a < 0) or (carry_in < 0):
												raise ValueError("""inputs must be positive."""			)

						if (
						    (math.floor(_lowerCAmelCase			) != input_a)
						    or (math.floor(_lowerCAmelCase			) != input_a)
						    or (math.floor(_lowerCAmelCase			) != carry_in)
						):
												raise ValueError("""inputs must be exact integers."""			)

						if (input_a > 2) or (input_a > 2) or (carry_in > 2):
												raise ValueError("""inputs must be less or equal to 2."""			)

						# build registers
						__magic_name__      :       List[str]       						= qiskit.QuantumRegister(4,   """qr"""			)
						__magic_name__      :       Optional[int]       						= qiskit.ClassicalRegister(2,   """cr"""			)
						# list the entries
						__magic_name__      :       List[Any]       						= [input_a, input_a, carry_in]

						__magic_name__      :       Union[str, Any]       						= qiskit.QuantumCircuit(_lowerCAmelCase,   _lowerCAmelCase			)

						for i in range(0,   3			):
												if entry[i] == 2:
																		quantum_circuit.h(_lowerCAmelCase			)  # for hadamard entries
												elif entry[i] == 1:
																		quantum_circuit.x(_lowerCAmelCase			)  # for 1 entries
												elif entry[i] == 0:
																		quantum_circuit.i(_lowerCAmelCase			)  # for 0 entries

    # build the circuit
						quantum_circuit.ccx(0,   1,   3			)  # ccx = toffoli gate
						quantum_circuit.cx(0,   1			)
						quantum_circuit.ccx(1,   2,   3			)
						quantum_circuit.cx(1,   2			)
						quantum_circuit.cx(0,   1			)

						quantum_circuit.measure([2, 3],   _lowerCAmelCase			)  # measure the last two qbits

						__magic_name__      :       int       						= qiskit.Aer.get_backend("""aer_simulator"""			)
						__magic_name__      :       Tuple       						= qiskit.execute(_lowerCAmelCase,   _lowerCAmelCase,   shots=1000			)

						return job.result().get_counts(_lowerCAmelCase			)


if __name__ == "__main__":
		print(F"""Total sum count for state is: {quantum_full_adder(1, 1, 1)}""")








from decimal import Decimal, getcontext
from math import ceil, factorial

def    UpperCamelCase						(	_A			):






						"""simple docstring"""







						if not isinstance(_A,   _A			):
												raise TypeError("""Undefined for non-integers"""			)
						elif precision < 1:
												raise ValueError("""Undefined for non-natural numbers"""			)

						__magic_name__      :       Dict       						= precision
						__magic_name__      :       str       						= ceil(precision / 14			)
						__magic_name__      :       List[str]       						= 426880 * Decimal(10005			).sqrt()
						__magic_name__      :       List[Any]       						= 1
						__magic_name__      :       Dict       						= 13591409
						__magic_name__      :       Tuple       						= Decimal(_A			)
						for k in range(1,   _A			):
												__magic_name__      :       List[Any]       						= factorial(6 * k			) // (factorial(3 * k			) * factorial(_A			) ** 3)
												linear_term += 545140134
												exponential_term *= -262537412640768000
												partial_sum += Decimal(multinomial_term * linear_term			) / exponential_term
						return str(constant_term / partial_sum			)[:-1]


if __name__ == "__main__":
		__magic_name__:					Tuple							=     50
		print(F"""The first {n} digits of pi is: {pi(n)}""")
