
import qiskit
from qiskit.providers import Backend


def  A__ (       __lowerCamelCase,  __lowerCamelCase						):
   SCREAMING_SNAKE_CASE_	, SCREAMING_SNAKE_CASE_	=      bin(__lowerCamelCase						)[2:], bin(__lowerCamelCase						)[2:]  # Remove leading '0b'

   # Ensure that both strings are of the same length
   if len(__lowerCamelCase						) > len(__lowerCamelCase						):
      SCREAMING_SNAKE_CASE_	=      y.zfill(len(__lowerCamelCase						)						)
   else:
      SCREAMING_SNAKE_CASE_	=      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
   SCREAMING_SNAKE_CASE_	=      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  A__ (       __lowerCamelCase,  __lowerCamelCase,  __lowerCamelCase,  __lowerCamelCase,  __lowerCamelCase,  ):
   circuit.ccx(__lowerCamelCase,  __lowerCamelCase,  __lowerCamelCase						)
   circuit.cx(__lowerCamelCase,  __lowerCamelCase						)
   circuit.ccx(__lowerCamelCase,  __lowerCamelCase,  __lowerCamelCase						)
   circuit.cx(__lowerCamelCase,  __lowerCamelCase						)
   circuit.cx(__lowerCamelCase,  __lowerCamelCase						)


def  A__ (       __lowerCamelCase,  __lowerCamelCase,  __lowerCamelCase = qiskit.Aer.get_backend('''aer_simulator'''						),  ):

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

   # Store the Integers
   SCREAMING_SNAKE_CASE_	, SCREAMING_SNAKE_CASE_	, SCREAMING_SNAKE_CASE_	=      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]						)

   SCREAMING_SNAKE_CASE_	=      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()




from math import sqrt


def  A__ (       __lowerCamelCase						):
   SCREAMING_SNAKE_CASE_	=      [1]
   for i in range(2,  int(sqrt(__lowerCamelCase						)						) + 1,  1						):
      if number % i == 0:
         values.append(__lowerCamelCase						)
         if int(number // i						) != i:
            values.append(int(number // i						)						)
   return sorted(__lowerCamelCase						)


def  A__ (       __lowerCamelCase						):
   return sum(factors(__lowerCamelCase						)						) > n


def  A__ (       __lowerCamelCase						):
   SCREAMING_SNAKE_CASE_	=      factors(__lowerCamelCase						)
   SCREAMING_SNAKE_CASE_	=      len(__lowerCamelCase						)
   SCREAMING_SNAKE_CASE_	=      [[0 for i in range(number + 1						)] for j in range(r + 1						)]
   for i in range(r + 1						):
      SCREAMING_SNAKE_CASE_	=      True

   for i in range(1,  number + 1						):
      SCREAMING_SNAKE_CASE_	=      False

   for i in range(1,  r + 1						):
      for j in range(1,  number + 1						):
         if j < values[i - 1]:
            SCREAMING_SNAKE_CASE_	=      subset[i - 1][j]
         else:
            SCREAMING_SNAKE_CASE_	=      subset[i - 1][j] or subset[i - 1][j - values[i - 1]]

   return subset[r][number] != 0


def  A__ (       __lowerCamelCase						):
   return abundant(__lowerCamelCase						) and not semi_perfect(__lowerCamelCase						)


if __name__ == "__main__":
   import doctest

   doctest.testmod(verbose=True)
   for number in (69, 70, 71):
      print(F"""{number} is {'' if weird(number) else 'not '}weird.""")


