


# A Bipartite Graph is a graph whose vertices can be divided into two independent sets,
# U and V such that every edge (u, v) either connects a vertex from U to V or a vertex
# from V to U. In other words, for every edge (u, v), either u belongs to U and v to V,
# or u belongs to V and v to U. We can also say that there is no edge that connects
# vertices of same set.
def 				UpperCAmelCase_					(							__snake_case						)     ->			Any:







 """simple docstring"""


 _lowercase							      =[False] * len(__snake_case						)
 _lowercase							      =[-1] * len(__snake_case						)

 def dfs(__snake_case     ,						__snake_case						):
  _lowercase							      =True
  _lowercase							      =c
  for u in graph[v]:
   if not visited[u]:
    dfs(__snake_case     ,						1 - c						)

 for i in range(len(__snake_case						)						):
  if not visited[i]:
   dfs(__snake_case     ,						0						)

 for i in range(len(__snake_case						)						):
  for j in graph[i]:
   if color[i] == color[j]:
    return False

 return True


# Adjacency list of graph
UpperCAmelCase__   	=							{0: [1, 3], 1: [0, 2], 2: [1, 3], 3: [0, 2], 4: []}



print(check_bipartite_dfs(graph))




"""simple docstring"""





def   _A  (  UpperCamelCase_     :       list[int])	->						float:
   '''simple docstring'''


   if not nums:  # Makes sure that the list is not empty
      raise ValueError("List is empty")

   __lowercase								=						sum(UpperCamelCase_) / len(UpperCamelCase_)  # Calculate the average
   return sum(abs(x - average) for x in nums) / len(UpperCamelCase_)


if __name__ == "__main__":
   import doctest

   doctest.testmod()




