





def       A__(		__lowerCAmelCase ):
				return "".join([hex(__lowerCAmelCase )[2:].zfill(2 ).upper() for byte in list(__lowerCAmelCase )] )

def       A__(		__lowerCAmelCase ):
				# Check data validity, following RFC3548
				# https://www.ietf.org/rfc/rfc3548.txt
				if (len(__lowerCAmelCase ) % 2) != 0:
								raise ValueError(
								    'Base16 encoded data is invalid:\nData does not have an even number of hex digits.' )
				# Check the character set - the standard base16 alphabet
				# is uppercase according to RFC3548 section 6
				if not set(__lowerCAmelCase ) <= set('0123456789ABCDEF' ):
								raise ValueError(
								    'Base16 encoded data is invalid:\nData is not uppercase hex or it contains invalid characters.' )
				# For every two hexadecimal digits (= a byte), turn it into an integer.
				# Then, string the result together into bytes, and return it.
				return bytes(int(data[i] + data[i + 1]	,			16 ) for i in range(0	,			len(__lowerCAmelCase )	,			2 ) )


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






