

'''simple docstring'''


lowerCAmelCase__      				=			{
    "0000": "0",
    "0001": "1",
    "0010": "2",
    "0011": "3",
    "0100": "4",
    "0101": "5",
    "0110": "6",
    "0111": "7",
    "1000": "8",
    "1001": "9",
    "1010": "a",
    "1011": "b",
    "1100": "c",
    "1101": "d",
    "1110": "e",
    "1111": "f",
}







def     SCREAMING_SNAKE_CASE(	UpperCamelCase	)     ->     str:
	UpperCAmelCase_		:   List[str]													=       str(UpperCamelCase	).strip()

	# Exceptions
	if not binary_str:
		raise ValueError('Empty string was passed to the function'	)
	UpperCAmelCase_		:   Tuple													=       binary_str[0] == '-'
	UpperCAmelCase_		:   List[str]													=       binary_str[1:] if is_negative else binary_str
	if not all(char in '01' for char in binary_str	):
		raise ValueError('Non-binary value was passed to the function'	)

	UpperCAmelCase_		:   Any													=       (
	    '0' * (4 * (divmod(len(UpperCamelCase	) ,4	)[0] + 1) - len(UpperCamelCase	)) + binary_str
	)

	UpperCAmelCase_		:   str													=       []
	for x in range(0 ,len(UpperCamelCase	) ,4	):
		hexadecimal.append(BITS_TO_HEX[binary_str[x : x + 4]]	)
	UpperCAmelCase_		:   Tuple													=       '0x' + ''.join(UpperCamelCase	)

	return "-" + hexadecimal_str if is_negative else hexadecimal_str


if __name__ == "__main__":
						from doctest import testmod

						testmod()









'''simple docstring'''


from __future__ import annotations







def     SCREAMING_SNAKE_CASE(	UpperCamelCase ,UpperCamelCase ,UpperCamelCase ,UpperCamelCase	)     ->     int:

	# Base Case
	if counter == 0 or capacity == 0:
		return 0

	# If weight of the nth item is more than Knapsack of capacity,
	#   then this item cannot be included in the optimal solution,
	# else return the maximum of two cases:
	#   (1) nth item included
	#   (2) not included
	if weights[counter - 1] > capacity:
		return knapsack(UpperCamelCase ,UpperCamelCase ,UpperCamelCase ,counter - 1	)
	else:
		UpperCAmelCase_		:   int													=       capacity - weights[counter - 1]
		UpperCAmelCase_		:   Optional[int]													=       values[counter - 1] + knapsack(
		    UpperCamelCase ,UpperCamelCase ,UpperCamelCase ,counter - 1	)
		UpperCAmelCase_		:   Any													=       knapsack(UpperCamelCase ,UpperCamelCase ,UpperCamelCase ,counter - 1	)
		return max(UpperCamelCase ,UpperCamelCase	)


if __name__ == "__main__":
						import doctest

						doctest.testmod()






