





UpperCAmelCase	:	Tuple		     =       {0: [2, 3], 1: [0], 2: [1], 3: [4], 4: []}

UpperCAmelCase	:	Optional[int]		     =       {0: [1, 2, 3], 1: [2], 2: [0], 3: [4], 4: [5], 5: [3]}
def      _A       (		SCREAMING_SNAKE_CASE     :   dict[int, list[int]]       ,       SCREAMING_SNAKE_CASE     :   int       ,       SCREAMING_SNAKE_CASE     :   list[bool]						):





  """simple docstring"""



  a__	:					Union[str, Any]										=True
  a__	:					Any										=[]

  for neighbour in graph[vert]:
    if not visited[neighbour]:
      order += topology_sort(SCREAMING_SNAKE_CASE       ,       SCREAMING_SNAKE_CASE       ,       SCREAMING_SNAKE_CASE						)

  order.append(SCREAMING_SNAKE_CASE						)

  return order
def      _A       (		SCREAMING_SNAKE_CASE     :   dict[int, list[int]]       ,       SCREAMING_SNAKE_CASE     :   int       ,       SCREAMING_SNAKE_CASE     :   list[bool]						):





  """simple docstring"""



  a__	:					List[str]										=True
  a__	:					Tuple										=[vert]

  for neighbour in reversed_graph[vert]:
    if not visited[neighbour]:
      component += find_components(SCREAMING_SNAKE_CASE       ,       SCREAMING_SNAKE_CASE       ,       SCREAMING_SNAKE_CASE						)

  return component





def      _A       (		SCREAMING_SNAKE_CASE     :   dict[int, list[int]]						):





  """simple docstring"""



  a__	:					str										=len(SCREAMING_SNAKE_CASE						) * [False]
  a__	:					dict[int, list[int]]										={vert: [] for vert in range(len(SCREAMING_SNAKE_CASE						)						)}

  for vert, neighbours in graph.items():
    for neighbour in neighbours:
      reversed_graph[neighbour].append(SCREAMING_SNAKE_CASE						)

  a__	:					Optional[Any]										=[]
  for i, was_visited in enumerate(SCREAMING_SNAKE_CASE						):
    if not was_visited:
      order += topology_sort(SCREAMING_SNAKE_CASE       ,       SCREAMING_SNAKE_CASE       ,       SCREAMING_SNAKE_CASE						)

  a__	:					List[str]										=[]
  a__	:					Optional[Any]										=len(SCREAMING_SNAKE_CASE						) * [False]

  for i in range(len(SCREAMING_SNAKE_CASE						)						):
    a__	:					Any										=order[len(SCREAMING_SNAKE_CASE						) - i - 1]
    if not visited[vert]:
      a__	:					List[str]										=find_components(SCREAMING_SNAKE_CASE       ,       SCREAMING_SNAKE_CASE       ,       SCREAMING_SNAKE_CASE						)
      components_list.append(SCREAMING_SNAKE_CASE						)

  return components_list













from __future__ import annotations

from collections.abc import Callable





def 						__SCREAMING_SNAKE_CASE  (				UpperCamelCase__			,			UpperCamelCase__			,			UpperCamelCase__			,			UpperCamelCase__ = 100			,			)  ->				float:







			'''simple docstring'''

			UpperCAmelCase   		=				x_start
			UpperCAmelCase   		=				fnc(UpperCamelCase__ )
			UpperCAmelCase   		=				0.0
			for _ in range(UpperCamelCase__ ):
						# Approximates small segments of curve as linear and solve
						# for trapezoidal area
						UpperCAmelCase   		=				(x_end - x_start) / steps + xa
						UpperCAmelCase   		=				fnc(UpperCamelCase__ )
						area += abs(fxa + fxa ) * (xa - xa) / 2
						# Increment step
						UpperCAmelCase   		=				xa
						UpperCAmelCase   		=				fxa
			return area


if __name__ == "__main__":





				def 						__SCREAMING_SNAKE_CASE  (				UpperCamelCase__ )  ->				str:







							'''simple docstring'''

							return x**3 + x**2

				print("f(x) = x^3 + x^2")
				print("The area between the curve, x = -5, x = 5 and the x axis is:")
				__A				:    List[Any]       =   10
				while i <= 100_000:
								print(F'with {i} steps: {trapezoidal_area(f, -5, 5, i)}')
								i *= 10



