

"""simple docstring"""

from queue import Queue



def 			SCREAMING_SNAKE_CASE       (   lowercase__      ) ->	List[str]:
 lowerCAmelCase__      :							Tuple    =							Queue()
 lowerCAmelCase__      :							Optional[int]    =							[False] * len(lowercase__      )
 lowerCAmelCase__      :							Dict    =							[-1] * len(lowercase__      )

 def bfs():
  while not queue.empty():
   lowerCAmelCase__      :							Optional[Any]    =							queue.get()
   lowerCAmelCase__      :							Union[str, Any]    =							True

   for neighbour in graph[u]:
    if neighbour == u:
     return False

    if color[neighbour] == -1:
     lowerCAmelCase__      :							Any    =							1 - color[u]
     queue.put(lowercase__      )

    elif color[neighbour] == color[u]:
     return False

  return True

 for i in range(len(lowercase__      )      ):
  if not visited[i]:
   queue.put(lowercase__      )
   lowerCAmelCase__      :							int    =							0
   if bfs() is False:
    return False

 return True


if __name__ == "__main__":
    # Adjacency List of graph
    print(check_bipartite({0: [1, 3], 1: [0, 2], 2: [1, 3], 3: [0, 2]}))









"""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() = }")






