

"""simple docstring"""

def 			SCREAMING_SNAKE_CASE       (   lowercase__      ) ->	list:
 lowerCAmelCase__      :							List[str]    =							len(lowercase__      )
 for cycle_start in range(0				,				array_len - 1      ):
  lowerCAmelCase__      :							Union[str, Any]    =							array[cycle_start]

  lowerCAmelCase__      :							Optional[Any]    =							cycle_start
  for i in range(cycle_start + 1				,				lowercase__      ):
   if array[i] < item:
    pos += 1

  if pos == cycle_start:
   continue

  while item == array[pos]:
   pos += 1

  lowerCAmelCase__      :							List[Any]    =							item, array[pos]
  while pos != cycle_start:
   lowerCAmelCase__      :							Optional[Any]    =							cycle_start
   for i in range(cycle_start + 1				,				lowercase__      ):
    if array[i] < item:
     pos += 1

   while item == array[pos]:
    pos += 1

   lowerCAmelCase__      :							Any    =							item, array[pos]

 return array


if __name__ == "__main__":
    assert cycle_sort([4, 5, 3, 2, 1]) == [1, 2, 3, 4, 5]
    assert cycle_sort([0, 1, -1_0, 1_5, 2, -2]) == [-1_0, -2, 0, 1, 2, 1_5]









"""simple docstring"""

from itertools import product



def 			SCREAMING_SNAKE_CASE       (   lowercase__ = 1_5      ) ->	int:
 lowerCAmelCase__      :							float    =							0.0
 lowerCAmelCase__      :							float
 lowerCAmelCase__      :							int
 lowerCAmelCase__      :							int
 lowerCAmelCase__      :							int
 lowerCAmelCase__      :							int
 lowerCAmelCase__      :							tuple[int, ...]

 for series in product(range(2      )				,				repeat=lowercase__      ):
  lowerCAmelCase__      :							Optional[int]    =							series.count(1      )
  lowerCAmelCase__      :							Dict    =							num_turns - num_blue
  if num_red >= num_blue:
   continue
  lowerCAmelCase__      :							Dict    =							1.0
  for ind, col in enumerate(lowercase__				,				2      ):
   if col == 0:
    prob *= (ind - 1) / ind
   else:
    prob *= 1 / ind

  total_prob += prob

 return int(1 / total_prob      )


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






