

"""simple docstring"""


UpperCAmelCase													="Tobias Carryer"

from time import time





class lowerCamelCase__   :



    '''simple docstring'''




    def __init__( self ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_=int(time()    )    )    ->      int:  # noqa: B008
          A				  =		multiplier
          A				  =		increment
          A				  =		modulo
          A				  =		seed




    def UpperCamelCase__		( self    )    ->      List[Any]:
          A				  =		(self.multiplier * self.seed + self.increment) % self.modulo
          return self.seed


if __name__ == "__main__":
  # Show the LCG in action.
  UpperCAmelCase													=LinearCongruentialGenerator(1_664_525, 1_013_904_223, 2 << 31)
  while True:
    print(lcg.next_number())







"""simple docstring"""


import unittest

from knapsack import greedy_knapsack as kp





class lowerCamelCase__   (				unittest.TestCase    ):



    '''simple docstring'''




    def UpperCamelCase__		( self    )    ->      Any:
          A				  =		[1_0, 2_0, 3_0, 4_0, 5_0, 6_0]
          A				  =		[2, 4, 6, 8, 1_0, 1_2]
          A				  =		1_0_0
          self.assertEqual(kp.calc_profit(lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_    ) ,2_1_0    )




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




    def UpperCamelCase__		( self    )    ->      Any:
          self.assertRaisesRegex(lowerCamelCase_ ,"""Weight can not be negative."""    )




    def UpperCamelCase__		( self    )    ->      str:
          self.assertRaisesRegex(lowerCamelCase_ ,"""Profit can not be negative."""    )




    def UpperCamelCase__		( self    )    ->      Optional[int]:
          self.assertRaisesRegex(lowerCamelCase_ ,"""max_weight must greater than zero."""    )




    def UpperCamelCase__		( self    )    ->      str:
          self.assertRaisesRegex(
              lowerCamelCase_ ,"""The length of profit and weight must be same."""    )


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




