


'''simple docstring'''
import unittest

from knapsack import greedy_knapsack as kp
class    lowercase	(							unittest.TestCase					):

		"""simple docstring"""

		def     lowerCAmelCase__				(		self							):

							'''simple docstring'''


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




		def     lowerCAmelCase__				(		self							):

							'''simple docstring'''


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




		def     lowerCAmelCase__				(		self							):

							'''simple docstring'''


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




		def     lowerCAmelCase__				(		self							):

							'''simple docstring'''


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




		def     lowerCAmelCase__				(		self							):

							'''simple docstring'''


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




		def     lowerCAmelCase__				(		self							):

							'''simple docstring'''


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


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





def 			_SCREAMING_SNAKE_CASE			(							lowercase	:       list     ):


      '''simple docstring'''



      for i in range(len(lowercase     ) - 1	,							0	,							-1     ):
            lowerCamelCase_		     =    False

            for j in range(lowercase	,							0	,							-1     ):
                  if unsorted[j] < unsorted[j - 1]:
                        lowerCamelCase_     ,				lowerCamelCase_		     =    unsorted[j - 1], unsorted[j]
                        lowerCamelCase_		     =    True

            for j in range(lowercase     ):
                  if unsorted[j] > unsorted[j + 1]:
                        lowerCamelCase_     ,				lowerCamelCase_		     =    unsorted[j + 1], unsorted[j]
                        lowerCamelCase_		     =    True

            if not swapped:
                  break
      return unsorted


if __name__ == "__main__":
 import doctest

 doctest.testmod()
 lowerCamelCase				:		Any     =   input("Enter numbers separated by a comma:\n").strip()
 lowerCamelCase				:		Dict     =   [int(item) for item in user_input.split(",")]
 print(F"""{cocktail_shaker_sort(unsorted) = }""")



