'''simple docstring'''






import functools






def  UpperCamelCase__					(					_lowercase    :				list[int]   ,    _lowercase    :				list[int]     )							->	int:

  # 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     ) >= 3_6_6:
    raise ValueError("""All days elements should be less than 366"""     )

  __UpperCAmelCase:					Optional[int]		= set(_lowercase     )

  @functools.cache
  def dynamic_programming(_lowercase    :				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()
'''simple docstring'''






from __future__ import annotations






def  UpperCamelCase__					(					_lowercase    :				list[int]   ,    _lowercase    :				int   ,    _lowercase    :				int   ,    _lowercase    :				int     )							->	None:
  if (direction == 1 and array[indexa] > array[indexa]) or (
      direction == 0 and array[indexa] < array[indexa]
  ):
    __UpperCAmelCase, __UpperCAmelCase:					str		= array[indexa], array[indexa]






def  UpperCamelCase__					(					_lowercase    :				list[int]   ,    _lowercase    :				int   ,    _lowercase    :				int   ,    _lowercase    :				int     )							->	None:
  if length > 1:
    __UpperCAmelCase:					List[str]		= int(length / 2     )
    for i in range(_lowercase   ,    low + middle     ):
      comp_and_swap(_lowercase   ,    _lowercase   ,    i + middle   ,    _lowercase     )
    bitonic_merge(_lowercase   ,    _lowercase   ,    _lowercase   ,    _lowercase     )
    bitonic_merge(_lowercase   ,    low + middle   ,    _lowercase   ,    _lowercase     )






def  UpperCamelCase__					(					_lowercase    :				list[int]   ,    _lowercase    :				int   ,    _lowercase    :				int   ,    _lowercase    :				int     )							->	None:
  if length > 1:
    __UpperCAmelCase:					Any		= int(length / 2     )
    bitonic_sort(_lowercase   ,    _lowercase   ,    _lowercase   ,    1     )
    bitonic_sort(_lowercase   ,    low + middle   ,    _lowercase   ,    0     )
    bitonic_merge(_lowercase   ,    _lowercase   ,    _lowercase   ,    _lowercase     )


if __name__ == "__main__":
    SCREAMING_SNAKE_CASE_	   =			input('Enter numbers separated by a comma:\n').strip()
    SCREAMING_SNAKE_CASE_	   =			[int(item.strip()) for item in user_input.split(',')]

    bitonic_sort(unsorted, 0, len(unsorted), 1)
    print('\nSorted array in ascending order is: ', end='')
    print(*unsorted, sep=', ')

    bitonic_merge(unsorted, 0, len(unsorted), 0)
    print('Sorted array in descending order is: ', end='')
    print(*unsorted, sep=', ')