


"""simple docstring"""


import unittest

from knapsack import greedy_knapsack as kp


class 			A__	(						unittest.TestCase):


					"""simple docstring"""

					def 		a__						(	self:						Optional[int]	)->    Union[str, Any]:
											lowerCamelCase					:					Tuple        =	[10, 20, 30, 40, 50, 60]
											lowerCamelCase					:					Union[str, Any]        =	[2, 4, 6, 8, 10, 12]
											lowerCamelCase					:					Union[str, Any]        =	100
											self.assertEqual(kp.calc_profit(__a     ,		__a     ,		__a	)     ,		210	)

					def 		a__						(	self:						str	)->    str:
											self.assertRaisesRegex(__a     ,		"""max_weight must greater than zero."""	)

					def 		a__						(	self:						str	)->    List[Any]:
											self.assertRaisesRegex(__a     ,		"""Weight can not be negative."""	)

					def 		a__						(	self:						Any	)->    Dict:
											self.assertRaisesRegex(__a     ,		"""Profit can not be negative."""	)

					def 		a__						(	self:						Optional[Any]	)->    List[Any]:
											self.assertRaisesRegex(__a     ,		"""max_weight must greater than zero."""	)







					def 		a__						(	self:						Optional[Any]	)->    Tuple:
											self.assertRaisesRegex(
											    __a     ,		"""The length of profit and weight must be same."""	)


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








"""simple docstring"""


from __future__ import annotations

__lowerCamelCase      :int	    =		10




def   snake_case		(     UpperCamelCase__       :						list[int]    )   ->      list[int]:
      lowerCamelCase					:					int        =	1
      lowerCamelCase					:					Union[str, Any]        =	max(UpperCamelCase__    )
      while placement <= max_digit:
            # declare and initialize empty buckets
            lowerCamelCase					:					list[list]        =	[[] for _ in range(UpperCamelCase__    )]
            # split list_of_ints between the buckets
            for i in list_of_ints:
                  lowerCamelCase					:					Any        =	int((i / placement) % RADIX    )
                  buckets[tmp].append(UpperCamelCase__    )
            # put each buckets' contents into list_of_ints
            lowerCamelCase					:					Dict        =	0
            for b in range(UpperCamelCase__    ):
                  for i in buckets[b]:
                        lowerCamelCase					:					List[str]        =	i
                        a += 1
        # move to next
            placement *= RADIX
      return list_of_ints


if __name__ == "__main__":
    import doctest

    doctest.testmod()




