


'''simple docstring'''







from __future__ import annotations






def    lowerCAmelCase__ (       lowerCamelCase  :    int						,lowerCamelCase  :    list[int]						,lowerCamelCase  :    list[int]						,lowerCamelCase  :    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(a_						,a_						,a_						,counter - 1     )
       else:
              _A  :			Union[str, Any]											=      capacity - weights[counter - 1]
              _A  :			Optional[Any]											=      values[counter - 1] + knapsack(
                  a_						,a_						,a_						,counter - 1     )
              _A  :			List[Any]											=      knapsack(a_						,a_						,a_						,counter - 1     )
              return max(a_						,a_     )


if __name__ == "__main__":
      import doctest

      doctest.testmod()










'''simple docstring'''







import itertools






def    lowerCAmelCase__ (       lowerCamelCase  :    int = 1000000     ):
       _A  :			str											=      [1]

       for i in itertools.count(len(lowerCamelCase     )     ):
              _A  :			Optional[Any]											=      0
              for j in itertools.count(1     ):
                     _A  :			int											=      -1 if j % 2 == 0 else +1
                     _A  :			Optional[Any]											=      (j * j * 3 - j) // 2
                     if index > i:
                            break
                     item += partitions[i - index] * sign
                     item %= number
                     index += j
                     if index > i:
                            break
                     item += partitions[i - index] * sign
                     item %= number

              if item == 0:
                     return i
              partitions.append(lowerCamelCase     )

       return 0


if __name__ == "__main__":
   import doctest

   doctest.testmod()

   print(f"""{solution() = }""")






