
from __future__ import annotations


def 		UpperCAmelCase    (			a_	,     a_	,     a_	,     a_		)	->			int:







				"""simple docstring"""



				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         =				capacity - weights[counter - 1]
								__A         =				values[counter - 1] + knapsack(
								    a_	,     a_	,     a_	,     counter - 1		)
								__A         =				knapsack(a_	,     a_	,     a_	,     counter - 1		)
								return max(a_	,     a_		)


if __name__ == "__main__":
					import doctest

					doctest.testmod()


def 		UpperCAmelCase    (			a_		)	->			int:







				"""simple docstring"""



				__A         =				str(a_		).strip()
				if not oct_string:
								raise ValueError("Empty string was passed to the function"		)
				__A         =				oct_string[0] == "-"
				if is_negative:
								__A         =				oct_string[1:]
				if not oct_string.isdigit() or not all(0 <= int(a_		) <= 7 for char in oct_string		):
								raise ValueError("Non-octal value was passed to the function"		)
				__A         =				0
				for char in oct_string:
								__A         =				8 * decimal_number + int(a_		)
				if is_negative:
								__A         =				-decimal_number
				return decimal_number


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

					testmod()
