






'''simple docstring'''

import math

import qiskit



def 							snake_case					(     a_							: int = 1    ,   a_							: int = 1    ,   a_							: int = 1	)       ->				qiskit.result.counts.Counts:





      """simple docstring"""

      if (
          isinstance(a_    ,   a_	)
          or isinstance(a_    ,   a_	)
          or isinstance(a_    ,   a_	)
      ):
            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(a_	) != input_a)
          or (math.floor(a_	) != input_a)
          or (math.floor(a_	) != 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
      UpperCamelCase_				:   Union[str, Any]					    =							qiskit.QuantumRegister(4    ,   """qr"""	)
      UpperCamelCase_				:   str					    =							qiskit.ClassicalRegister(2    ,   """cr"""	)
      # list the entries
      UpperCamelCase_				:   Optional[int]					    =							[input_a, input_a, carry_in]

      UpperCamelCase_				:   int					    =							qiskit.QuantumCircuit(a_    ,   a_	)

      for i in range(0    ,   3	):
            if entry[i] == 2:
                  quantum_circuit.h(a_	)  # for hadamard entries
            elif entry[i] == 1:
                  quantum_circuit.x(a_	)  # for 1 entries
            elif entry[i] == 0:
                  quantum_circuit.i(a_	)  # 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]    ,   a_	)  # measure the last two qbits

      UpperCamelCase_				:   int					    =							qiskit.Aer.get_backend("""aer_simulator"""	)
      UpperCamelCase_				:   List[Any]					    =							qiskit.execute(a_    ,   a_    ,   shots=1_000	)

      return job.result().get_counts(a_	)


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














'''simple docstring'''

from itertools import count



def 							snake_case					(     a_							: int = 50	)       ->				int:





      """simple docstring"""

      UpperCamelCase_				:   int					    =							[1] * min_block_length

      for n in count(a_	):
            fill_count_functions.append(1	)

            for block_length in range(a_    ,   n + 1	):
                  for block_start in range(n - block_length	):
                        fill_count_functions[n] += fill_count_functions[
                            n - block_start - block_length - 1
                        ]

                  fill_count_functions[n] += 1

            if fill_count_functions[n] > 1_000_000:
                  break

      return n


if __name__ == "__main__":
      print(f"{solution() = }")






