




from __future__ import annotations



def 						lowerCAmelCase		(		_lowerCAmelCase							:   list[int]						,							_lowerCAmelCase							:   int						,							_lowerCAmelCase							:   int						,							_lowerCAmelCase							:   int	):




 """simple docstring"""







 if (direction == 1 and array[indexa] > array[indexa]) or (
     direction == 0 and array[indexa] < array[indexa]
 ):
  UpperCAmelCase__ , UpperCAmelCase__							 =						array[indexa], array[indexa]



def 						lowerCAmelCase		(		_lowerCAmelCase							:   list[int]						,							_lowerCAmelCase							:   int						,							_lowerCAmelCase							:   int						,							_lowerCAmelCase							:   int	):




 """simple docstring"""







 if length > 1:
  UpperCAmelCase__							 =						int(length / 2	)
  for i in range(_lowerCAmelCase						,							low + middle	):
   comp_and_swap(_lowerCAmelCase						,							_lowerCAmelCase						,							i + middle						,							_lowerCAmelCase	)
  bitonic_merge(_lowerCAmelCase						,							_lowerCAmelCase						,							_lowerCAmelCase						,							_lowerCAmelCase	)
  bitonic_merge(_lowerCAmelCase						,							low + middle						,							_lowerCAmelCase						,							_lowerCAmelCase	)



def 						lowerCAmelCase		(		_lowerCAmelCase							:   list[int]						,							_lowerCAmelCase							:   int						,							_lowerCAmelCase							:   int						,							_lowerCAmelCase							:   int	):




 """simple docstring"""







 if length > 1:
  UpperCAmelCase__							 =						int(length / 2	)
  bitonic_sort(_lowerCAmelCase						,							_lowerCAmelCase						,							_lowerCAmelCase						,							1	)
  bitonic_sort(_lowerCAmelCase						,							low + middle						,							_lowerCAmelCase						,							0	)
  bitonic_merge(_lowerCAmelCase						,							_lowerCAmelCase						,							_lowerCAmelCase						,							_lowerCAmelCase	)


if __name__ == "__main__":
  _lowerCAmelCase						:   Union[str, Any]		=   input("Enter numbers separated by a comma:\n").strip()
  _lowerCAmelCase						:   List[Any]		=   [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=", ")











import math



def 						lowerCAmelCase		(		_lowerCAmelCase							:   int	):




 """simple docstring"""







 UpperCAmelCase__							 =						math.loga(math.sqrt(4 * positive_integer + 1	) / 2 + 1 / 2	)

 return exponent == int(_lowerCAmelCase	)



def 						lowerCAmelCase		(		_lowerCAmelCase							:   float = 1 / 1_2345	):




 """simple docstring"""







 UpperCAmelCase__							 =						0
 UpperCAmelCase__							 =						0

 UpperCAmelCase__							 =						3
 while True:
  UpperCAmelCase__							 =						(integer**2 - 1) / 4
  # if candidate is an integer, then there is a partition for k
  if partition_candidate == int(_lowerCAmelCase	):
   UpperCAmelCase__							 =						int(_lowerCAmelCase	)
   total_partitions += 1
   if check_partition_perfect(_lowerCAmelCase	):
    perfect_partitions += 1
  if perfect_partitions > 0:
   if perfect_partitions / total_partitions < max_proportion:
    return int(_lowerCAmelCase	)
  integer += 1


if __name__ == "__main__":
  print(F'''{solution() = }''')





