

def 							__SCREAMING_SNAKE_CASE     (   a__    :   list			,a__    :   list			,a__    :   int			,a__    :   int			,a__    :   int       )					->				int:
	if index == number_of_items:
		return 0
	__A :			Optional[int]		    =			0
	__A :			List[Any]		    =			0
	__A :			int		    =			knapsack(a__			,a__			,a__			,a__			,index + 1       )
	if weights[index] <= max_weight:
		__A :			Union[str, Any]		    =			values[index] + knapsack(
		    a__			,a__			,a__			,max_weight - weights[index]			,index + 1       )
	return max(a__			,a__       )


if __name__ == "__main__":
			import doctest

			doctest.testmod()










'''simple docstring'''





import functools

def 			a_	(				_lowerCAmelCase			,_lowerCAmelCase			) -> int:

  # Validation
  if not isinstance(_lowerCAmelCase			,_lowerCAmelCase			) or not all(isinstance(_lowerCAmelCase			,_lowerCAmelCase			) for day in days			):
    raise ValueError('The parameter days should be a list of integers'			)

  if len(_lowerCAmelCase			) != 3 or not all(isinstance(_lowerCAmelCase			,_lowerCAmelCase			) for cost in costs			):
    raise ValueError('The parameter costs should be a list of three integers'			)

  if len(_lowerCAmelCase			) == 0:
    return 0

  if min(_lowerCAmelCase			) <= 0:
    raise ValueError('All days elements should be greater than 0'			)

  if max(_lowerCAmelCase			) >= 366:
    raise ValueError('All days elements should be less than 366'			)

  __lowerCamelCase			:			int       			=					set(_lowerCAmelCase			)

  @functools.cache
  def dynamic_programming(_lowerCAmelCase			) -> int:
    if index > 365:
      return 0

    if index not in days_set:
      return dynamic_programming(index + 1			)

    return min(
        costs[0] + dynamic_programming(index + 1			)			,costs[1] + dynamic_programming(index + 7			)			,costs[2] + dynamic_programming(index + 30			)			,)

  return dynamic_programming(1			)


if __name__ == "__main__":
   import doctest

   doctest.testmod()






