






import unittest

from knapsack import greedy_knapsack as kp







class 	_UpperCAmelCase  (  unittest.TestCase		):




      """simple docstring"""



      def 			snake_case_      (   self		):



          '''simple docstring'''
          lowerCAmelCase__   :List[Any]      							=				[10, 20, 30, 40, 50, 60]
          lowerCAmelCase__   :Optional[int]      							=				[2, 4, 6, 8, 10, 12]
          lowerCAmelCase__   :List[str]      							=				100
          self.assertEqual(kp.calc_profit(_snake_case    ,	_snake_case    ,	_snake_case		)    ,	210		)
      def 			snake_case_      (   self		):



          '''simple docstring'''
          self.assertRaisesRegex(_snake_case    ,	"max_weight must greater than zero."		)
      def 			snake_case_      (   self		):



          '''simple docstring'''
          self.assertRaisesRegex(_snake_case    ,	"Weight can not be negative."		)
      def 			snake_case_      (   self		):



          '''simple docstring'''
          self.assertRaisesRegex(_snake_case    ,	"Profit can not be negative."		)
      def 			snake_case_      (   self		):



          '''simple docstring'''
          self.assertRaisesRegex(_snake_case    ,	"max_weight must greater than zero."		)



      def 			snake_case_      (   self		):



          '''simple docstring'''
          self.assertRaisesRegex(
              _snake_case    ,	"The length of profit and weight must be same."		)


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









def 				snake_case__							(							UpperCAmelCase							:  float       ):

    if edge <= 0 or not isinstance(UpperCAmelCase    ,			UpperCAmelCase       ):
        raise ValueError("Length must be a positive."       )
    return 3 * ((2_5 + 1_0 * (5 ** (1 / 2))) ** (1 / 2)) * (edge**2)


def 				snake_case__							(							UpperCAmelCase							:  float       ):

    if edge <= 0 or not isinstance(UpperCAmelCase    ,			UpperCAmelCase       ):
        raise ValueError("Length must be a positive."       )
    return ((1_5 + (7 * (5 ** (1 / 2)))) / 4) * (edge**3)


if __name__ == "__main__":
 import doctest

 doctest.testmod()



