



"""simple docstring"""






from math import pi, sqrt






def 					snake_case__       (		__lowerCamelCase    :   float     ):
			"""simple docstring"""
			if num <= 0:
						raise ValueError('''math domain error'''     )
			if num > 1_71.5:
						raise OverflowError('''math range error'''     )
			elif num - int(__lowerCamelCase     ) not in (0, 0.5):
						raise NotImplementedError('''num must be an integer or a half-integer'''     )
			elif num == 0.5:
						return sqrt(__lowerCamelCase     )
			else:
						return 1.0 if num == 1 else (num - 1) * gamma(num - 1     )






def 					snake_case__       (		):
			"""simple docstring"""
			assert gamma(0.5     ) == sqrt(__lowerCamelCase     )
			assert gamma(1     ) == 1.0
			assert gamma(2     ) == 1.0


if __name__ == "__main__":
		from doctest import testmod

		testmod()
		_lowercase			:			Union[str, Any]										=						1.0
		while num:
				_lowercase			:			Optional[int]										=						float(input("Gamma of: "))
				print(f'gamma({num}) = {gamma(num)}')
				print("\nEnter 0 to exit...")









"""simple docstring"""






def 					snake_case__       (		__lowerCamelCase    :   int     ):
			"""simple docstring"""
			lowerCamelCase__		:		List[Any]		     =[0] * len(__lowerCamelCase     )
			lowerCamelCase__		:		List[Any]		     =[]
			lowerCamelCase__		:		List[Any]		     =[1] * len(__lowerCamelCase     )

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

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

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

									if long_dist[vertex] + 1 > long_dist[x]:
												lowerCamelCase__		:		Optional[Any]		     =long_dist[vertex] + 1

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

			print(max(__lowerCamelCase     )     )


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

longest_distance(graph)




