



from __future__ import annotations

from collections.abc import Iterator
from typing import Any



class 						_snake_case :





 """simple docstring"""



 def __init__(  self		,      a   )		->							None:




   """simple docstring"""







   _A          =      data
   _A          =      None



 def __str__(  self   )		->							str:




   """simple docstring"""







   return f'''{self.data}'''







class 						_snake_case :





 """simple docstring"""



 def __init__(  self   )		->							None:




   """simple docstring"""







   _A          =      None
   _A          =      None
 def __iter__(  self   )		->							Iterator[Any]:




   """simple docstring"""







   _A          =      self.front
   while node:
     yield node.data
     _A          =      node.next
 def __len__(  self   )		->							int:




   """simple docstring"""







   return len(tuple(iter(self   )   )   )
 def __str__(  self   )		->							str:




   """simple docstring"""







   return " <- ".join(str(a   ) for item in self   )
 def lowercase_						(  self   )		->							bool:




   """simple docstring"""







   return len(self   ) == 0
 def lowercase_						(  self		,      a   )		->							None:




   """simple docstring"""







   _A          =      Node(a   )
   if self.is_empty():
     _A          =      _A          =      node
   else:
     assert isinstance(self.rear		,      a   )
     _A          =      node
     _A          =      node
 def lowercase_						(  self   )		->							Any:




   """simple docstring"""







   if self.is_empty():
     raise IndexError('''dequeue from empty queue'''   )
   assert isinstance(self.front		,      a   )
   _A          =      self.front
   _A          =      self.front.next
   if self.front is None:
     _A          =      None
   return node.data



 def lowercase_						(  self   )		->							None:




   """simple docstring"""







   _A          =      _A          =      None


if __name__ == "__main__":
    from doctest import testmod

    testmod()




from __future__ import annotations




def       UpperCAmelCase__	(							__snake_case  ,			__snake_case  ,			__snake_case  ,			__snake_case							)				->	int:

  # Base Case
  if counter == 0 or capacity == 0:
    return 0

  # If weight of the nth item is more than Knapsack of capacity,
  #   then this item cannot be included in the optimal solution,
  # else return the maximum of two cases:
  #   (1) nth item included
  #   (2) not included
  if weights[counter - 1] > capacity:
    return knapsack(__snake_case  ,			__snake_case  ,			__snake_case  ,			counter - 1							)
  else:
    _A          =      capacity - weights[counter - 1]
    _A          =      values[counter - 1] + knapsack(
        __snake_case  ,			__snake_case  ,			__snake_case  ,			counter - 1							)
    _A          =      knapsack(__snake_case  ,			__snake_case  ,			__snake_case  ,			counter - 1							)
    return max(__snake_case  ,			__snake_case							)


if __name__ == "__main__":
    import doctest

    doctest.testmod()