





def       A__(		__lowerCAmelCase	,			__lowerCAmelCase ):
				if number < 0 or shift_amount < 0:
								raise ValueError('both inputs must be positive integers' )

				_snake_case :			Optional[int]  						=   str(bin(__lowerCAmelCase ) )
				binary_number += "0" * shift_amount
				return binary_number

def       A__(		__lowerCAmelCase	,			__lowerCAmelCase ):
				if number < 0 or shift_amount < 0:
								raise ValueError('both inputs must be positive integers' )

				_snake_case :			Dict  						=   str(bin(__lowerCAmelCase ) )[2:]
				if shift_amount >= len(__lowerCAmelCase ):
								return "0b0"
				_snake_case :			str  						=   binary_number[: len(__lowerCAmelCase ) - shift_amount]
				return "0b" + shifted_binary_number

def       A__(		__lowerCAmelCase	,			__lowerCAmelCase ):
				if number >= 0:  # Get binary representation of positive number
								_snake_case :			int  						=   '0' + str(bin(__lowerCAmelCase ) ).strip('-' )[2:]
				else:  # Get binary (2's complement) representation of negative number
								_snake_case :			str  						=   len(bin(__lowerCAmelCase )[3:] )  # Find 2's complement of number
								_snake_case :			Optional[Any]  						=   bin(abs(__lowerCAmelCase ) - (1 << binary_number_length) )[3:]
								_snake_case :			int  						=   (
								    '1' + '0' * (binary_number_length - len(__lowerCAmelCase )) + binary_number
								)

				if shift_amount >= len(__lowerCAmelCase ):
								return "0b" + binary_number[0] * len(__lowerCAmelCase )
				return (
				    "0b"
				    + binary_number[0] * shift_amount
				    + binary_number[: len(__lowerCAmelCase ) - shift_amount]
				)


if __name__ == "__main__":
		import doctest

		doctest.testmod()













from __future__ import annotations

def       A__(		__lowerCAmelCase	,			__lowerCAmelCase	,			__lowerCAmelCase ):
				_snake_case :			Dict  						=   list(range(len(__lowerCAmelCase ) ) )
				_snake_case :			Optional[int]  						=   [v / w for v, w in zip(__lowerCAmelCase	,			__lowerCAmelCase )]
				index.sort(key=lambda __lowerCAmelCase : ratio[i]	,			reverse=__lowerCAmelCase )

				_snake_case :			float  						=   0
				_snake_case :			list[float]  						=   [0] * len(__lowerCAmelCase )
				for i in index:
								if weight[i] <= capacity:
												_snake_case :			List[Any]  						=   1
												max_value += value[i]
												capacity -= weight[i]
								else:
												_snake_case :			Any  						=   capacity / weight[i]
												max_value += value[i] * capacity / weight[i]
												break

				return max_value, fractions


if __name__ == "__main__":
		import doctest

		doctest.testmod()






