'''simple docstring'''






import functools





def  _SCREAMING_SNAKE_CASE		(      __snake_case							:			list[int]   ,		__snake_case							:			list[int]				):

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

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

     if len(__snake_case				) == 0:
          return 0

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

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

     _A    		=  set(__snake_case				)

     @functools.cache
     def dynamic_programming(__snake_case							:			int				) -> int:
          if index > 3_6_5:
               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 + 3_0				)   ,		)

     return dynamic_programming(1				)


if __name__ == "__main__":
   import doctest

   doctest.testmod()










from __future__ import annotations

import math





def 				__lowerCAmelCase(       _SCREAMING_SNAKE_CASE				)							-> list[int]:




    """simple docstring"""




    if num <= 0:
        _A     =							F"{num}: Invalid input, please enter a positive integer."
        raise ValueError(_SCREAMING_SNAKE_CASE				)

    _A     =							[True] * (num + 1)
    _A     =							[]
    _A     =							2
    _A     =							int(math.sqrt(_SCREAMING_SNAKE_CASE				)				)

    while start <= end:
        # If start is a prime
        if sieve[start] is True:
            prime.append(_SCREAMING_SNAKE_CASE				)

            # Set multiples of start be False
            for i in range(start * start							,     num + 1							,     _SCREAMING_SNAKE_CASE				):
                if sieve[i] is True:
                    _A     =							False

        start += 1

    for j in range(end + 1							,     num + 1				):
        if sieve[j] is True:
            prime.append(_SCREAMING_SNAKE_CASE				)

    return prime


if __name__ == "__main__":
 print(prime_sieve(int(input("Enter a positive integer: ").strip())))





