import functools




def    lowerCAmelCase_  (		lowercase:				list[int]	,       lowercase:				list[int]		)     ->					int:







 '''simple docstring'''

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

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

 if len(lowercase		) == 0:
  return 0

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

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

 _UpperCamelCase:  List[str]    						=			set(lowercase		)

 @functools.cache
 def dynamic_programming(lowercase:				int		) -> 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()
from sympy import diff, lambdify, symbols
from sympy.functions import *  # noqa: F403




def    lowerCAmelCase_  (		lowercase:				str	,       lowercase:				complex	,       lowercase:				str = "x"	,       lowercase:				float = 10**-10	,       lowercase:				int = 1	,       )     ->					complex:







 '''simple docstring'''
 _UpperCamelCase:  Any    						=			symbols(lowercase		)
 _UpperCamelCase:  str    						=			lambdify(lowercase	,       lowercase		)
 _UpperCamelCase:  str    						=			lambdify(lowercase	,       diff(lowercase	,       lowercase		)		)

 _UpperCamelCase:  Optional[int]    						=			starting_point

 while True:
  if diff_function(lowercase		) != 0:
   _UpperCamelCase:  int    						=			prev_guess - multiplicity * func(lowercase		) / diff_function(
       lowercase		)
  else:
   raise ZeroDivisionError('''Could not find root'''		) from None

  # Precision is checked by comparing the difference of consecutive guesses
  if abs(next_guess - prev_guess		) < precision:
   return next_guess

  _UpperCamelCase:  Any    						=			next_guess


# Let's Execute
if __name__ == "__main__":
  # Find root of trigonometric function
  # Find value of pi
  print(f"""The root of sin(x) = 0 is {newton_raphson('sin(x)', 2)}""")

  # Find root of polynomial
  # Find fourth Root of 5
  print(f"""The root of x**4 - 5 = 0 is {newton_raphson('x**4 -5', 0.4 +5J)}""")

  # Find value of e
  print(
      '''The root of log(y) - 1 = 0 is ''',
      f"""{newton_raphson('log(y) - 1', 2, variable='y')}""",
  )

  # Exponential Roots
  print(
      '''The root of exp(x) - 1 = 0 is''',
      f"""{newton_raphson('exp(x) - 1', 1_0, precision=0.0_0_5)}""",
  )

  # Find root of cos(x)
  print(f"""The root of cos(x) = 0 is {newton_raphson('cos(x)', 0)}""")