

'''simple docstring'''





def       __lowerCamelCase			(				UpperCamelCase__   ):







							'''simple docstring'''






							snake_case_           =					[0] * len(UpperCamelCase__   )
							snake_case_           =					[]
							snake_case_           =					[1] * len(UpperCamelCase__   )

							for values in graph.values():
														for i in values:
																					indegree[i] += 1

							for i in range(len(UpperCamelCase__   )   ):
														if indegree[i] == 0:
																					queue.append(UpperCamelCase__   )

							while queue:
														snake_case_           =					queue.pop(0   )
														for x in graph[vertex]:
																					indegree[x] -= 1

																					if long_dist[vertex] + 1 > long_dist[x]:
																												snake_case_           =					long_dist[vertex] + 1

																					if indegree[x] == 0:
																												queue.append(UpperCamelCase__   )

							print(max(UpperCamelCase__   )   )


# Adjacency list of Graph
_UpperCAmelCase	:     Optional[int]		       = {0: [2, 3, 4], 1: [2, 7], 2: [5], 3: [5, 7], 4: [7], 5: [6], 6: [7], 7: []}


longest_distance(graph)







def       __lowerCamelCase			(				UpperCamelCase__   ):







							'''simple docstring'''






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

							snake_case_           =					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()




