




'''simple docstring'''


class      A       :







							def __init__(    self			:    int				,     lowerCAmelCase_			:    Union[str, Any]				,     lowerCAmelCase_			:    Dict				,     lowerCAmelCase_			:    List[str]   )     ->				Dict:


														"""simple docstring"""


														_a      	=							name
														_a      	=							value
														_a      	=							weight







							def __repr__(    self			:    Dict   )     ->				int:


														"""simple docstring"""


														return F'{self.__class__.__name__}({self.name}, {self.value}, {self.weight})'







							def   __lowerCAmelCase     (    self			:    Any   )     ->				Optional[Any]:


														"""simple docstring"""


														return self.value







							def   __lowerCAmelCase     (    self			:    Any   )     ->				List[Any]:


														"""simple docstring"""


														return self.name







							def   __lowerCAmelCase     (    self			:    Optional[Any]   )     ->				Union[str, Any]:


														"""simple docstring"""


														return self.weight







							def   __lowerCAmelCase     (    self			:    List[Any]   )     ->				Optional[int]:


														"""simple docstring"""


														return self.value / self.weight



def 						snake_case_       (UpperCamelCase			:    Tuple					,		UpperCamelCase			:    Optional[int]					,		UpperCamelCase			:    Optional[int] ):





							'''simple docstring'''


							_a      	=							[]
							for i in range(len(UpperCamelCase ) ):
														menu.append(Things(name[i]					,		value[i]					,		weight[i] ) )
							return menu
def 						snake_case_       (UpperCamelCase			:    Union[str, Any]					,		UpperCamelCase			:    List[str]					,		UpperCamelCase			:    List[Any] ):





							'''simple docstring'''


							_a      	=							sorted(UpperCamelCase					,		key=UpperCamelCase					,		reverse=UpperCamelCase )
							_a      	=							[]
							_a	,				_a      	=							0.0, 0.0
							for i in range(len(UpperCamelCase ) ):
														if (total_cost + items_copy[i].get_weight()) <= max_cost:
																					result.append(items_copy[i] )
																					total_cost += items_copy[i].get_weight()
																					total_value += items_copy[i].get_value()
							return (result, total_value)
def 						snake_case_       ():





							'''simple docstring'''




if __name__ == "__main__":
				import doctest

				doctest.testmod()







'''simple docstring'''


import qiskit
def 						snake_case_       (UpperCamelCase			:    int					,		UpperCamelCase			:    int ):





							'''simple docstring'''


							_a      	=							qiskit.Aer.get_backend('''aer_simulator''' )

							_a      	=							qiskit.QuantumCircuit(4					,		2 )
							# encode inputs in qubits 0 and 1
							if bita == 1:
														qc_ha.x(0 )
							if bita == 1:
														qc_ha.x(1 )
							qc_ha.barrier()

							# use cnots to write XOR of the inputs on qubit2
							qc_ha.cx(0					,		2 )
							qc_ha.cx(1					,		2 )

							# use ccx / toffoli gate to write AND of the inputs on qubit3
							qc_ha.ccx(0					,		1					,		3 )
							qc_ha.barrier()

							# extract outputs
							qc_ha.measure(2					,		0 )  # extract XOR value
							qc_ha.measure(3					,		1 )  # extract AND value

							# Execute the circuit on the qasm simulator
							_a      	=							qiskit.execute(UpperCamelCase					,		UpperCamelCase					,		shots=1000 )

							# Return the histogram data of the results of the experiment
							return job.result().get_counts(UpperCamelCase )


if __name__ == "__main__":
				_snake_case : Tuple  				=						half_adder(1, 1)
				print(F'''Half Adder Output Qubit Counts: {counts}''')

