



'''simple docstring'''





from functools import lru_cache

def 			a_	(				_lowerCAmelCase			) -> set:
  __lowerCamelCase			:			int       			=					2
  __lowerCamelCase			:			List[str]       			=					set()
  while i * i <= n:
    if n % i:
      i += 1
    else:
      n //= i
      factors.add(_lowerCAmelCase			)
  if n > 1:
    factors.add(_lowerCAmelCase			)
  return factors

@lru_cache
def 			a_	(				_lowerCAmelCase			) -> int:
  return len(unique_prime_factors(_lowerCAmelCase			)			)

def 			a_	(				_lowerCAmelCase			) -> bool:
  return len(set(_lowerCAmelCase			)			) in (0, 1)

def 			a_	(				_lowerCAmelCase			) -> list:
  __lowerCamelCase			:			Union[str, Any]       			=					2

  while True:
    # Increment each value of a generated range
    __lowerCamelCase			:			Tuple       			=					[base + i for i in range(_lowerCAmelCase			)]

    # Run elements through out unique_prime_factors function
    # Append our target number to the end.
    __lowerCamelCase			:			Any       			=					[upf_len(_lowerCAmelCase			) for x in group]
    checker.append(_lowerCAmelCase			)

    # If all numbers in the list are equal, return the group variable.
    if equality(_lowerCAmelCase			):
      return group

    # Increment our base variable by 1
    base += 1

def 			a_	(				_lowerCAmelCase = 4			) -> int:
  __lowerCamelCase			:			List[Any]       			=					run(_lowerCAmelCase			)
  return results[0] if len(_lowerCAmelCase			) else None


if __name__ == "__main__":
   print(solution())











'''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()






