



'''simple docstring'''

_A				:    Dict     						={
    0: '''0''',
    1: '''1''',
    2: '''2''',
    3: '''3''',
    4: '''4''',
    5: '''5''',
    6: '''6''',
    7: '''7''',
    8: '''8''',
    9: '''9''',
    1_0: '''a''',
    1_1: '''b''',
    1_2: '''c''',
    1_3: '''d''',
    1_4: '''e''',
    1_5: '''f''',
}







def 						__UpperCamelCase				(							_lowercase					) ->			str:
	assert type(_lowercase					) in (int, float) and decimal == int(_lowercase					)
	_lowercase					:       int       =		int(_lowercase					)
	_lowercase					:       Dict       =		''
	_lowercase					:       Optional[int]       =		False
	if decimal < 0:
		_lowercase					:       Optional[int]       =		True
		decimal *= -1
	while decimal > 0:
		_lowercase  ,    _lowercase					:       str       =		divmod(_lowercase,				16					)
		_lowercase					:       List[str]       =		values[remainder] + hexadecimal
	_lowercase					:       Optional[Any]       =		'0x' + hexadecimal
	if negative:
		_lowercase					:       Optional[Any]       =		'-' + hexadecimal
	return hexadecimal


if __name__ == "__main__":
		import doctest

		doctest.testmod()





'''simple docstring'''

import unittest

from knapsack import greedy_knapsack as kp



class 		lowerCamelCase__      (						unittest.TestCase     ):




					'''simple docstring'''



					def 						__UpperCAmelCase     (  self				:	int					)  ->       Any:



						'''simple docstring'''





						_lowercase					:       List[Any]       =		[10, 20, 30, 40, 50, 60]
						_lowercase					:       Tuple       =		[2, 4, 6, 8, 10, 12]
						_lowercase					:       Optional[Any]       =		100
						self.assertEqual(kp.calc_profit(UpperCamelCase_     ,  UpperCamelCase_     ,  UpperCamelCase_					)     ,  210					)




					def 						__UpperCAmelCase     (  self				:	int					)  ->       int:



						'''simple docstring'''





						self.assertRaisesRegex(UpperCamelCase_     ,  'max_weight must greater than zero.'					)




					def 						__UpperCAmelCase     (  self				:	Dict					)  ->       Optional[Any]:



						'''simple docstring'''





						self.assertRaisesRegex(UpperCamelCase_     ,  'Weight can not be negative.'					)




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



						'''simple docstring'''





						self.assertRaisesRegex(UpperCamelCase_     ,  'Profit can not be negative.'					)




					def 						__UpperCAmelCase     (  self				:	int					)  ->       List[str]:



						'''simple docstring'''





						self.assertRaisesRegex(UpperCamelCase_     ,  'max_weight must greater than zero.'					)




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



						'''simple docstring'''





						self.assertRaisesRegex(
						    UpperCamelCase_     ,  'The length of profit and weight must be same.'					)


if __name__ == "__main__":
		unittest.main()
