






def 	__lowerCamelCase      (		snake_case__	,snake_case__	,snake_case__		)							->  float:






						"""simple docstring"""





						if principal <= 0:
												raise Exception("""Principal borrowed must be > 0"""		)
						if rate_per_annum < 0:
												raise Exception("""Rate of interest must be >= 0"""		)
						if years_to_repay <= 0 or not isinstance(snake_case__	,snake_case__		):
												raise Exception("""Years to repay must be an integer > 0"""		)

						# Yearly rate is divided by 12 to get monthly rate
						_SCREAMING_SNAKE_CASE     				=  rate_per_annum / 12

						# Years to repay is multiplied by 12 to get number of payments as payment is monthly
						_SCREAMING_SNAKE_CASE     				=  years_to_repay * 12

						return (
						    principal
						    * rate_per_month
						    * (1 + rate_per_month) ** number_of_payments
						    / ((1 + rate_per_month) ** number_of_payments - 1)
						)


if __name__ == "__main__":
		import doctest

		doctest.testmod()









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

UpperCamelCase			    =     {0: [1, 2, 3], 1: [2], 2: [0], 3: [4], 4: [5], 5: [3]}

def 	__lowerCamelCase      (		snake_case__	,snake_case__	,snake_case__		)							->  list[int]:






						"""simple docstring"""





						_SCREAMING_SNAKE_CASE     				=  True
						_SCREAMING_SNAKE_CASE     				=  []

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

						order.append(snake_case__		)

						return order

def 	__lowerCamelCase      (		snake_case__	,snake_case__	,snake_case__		)							->  list[int]:






						"""simple docstring"""





						_SCREAMING_SNAKE_CASE     				=  True
						_SCREAMING_SNAKE_CASE     				=  [vert]

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

						return component




def 	__lowerCamelCase      (		snake_case__		)							->  list[list[int]]:






						"""simple docstring"""





						_SCREAMING_SNAKE_CASE     				=  len(snake_case__		) * [False]
						_SCREAMING_SNAKE_CASE     				=  {vert: [] for vert in range(len(snake_case__		)		)}

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

						_SCREAMING_SNAKE_CASE     				=  []
						for i, was_visited in enumerate(snake_case__		):
												if not was_visited:
																		order += topology_sort(snake_case__	,snake_case__	,snake_case__		)

						_SCREAMING_SNAKE_CASE     				=  []
						_SCREAMING_SNAKE_CASE     				=  len(snake_case__		) * [False]

						for i in range(len(snake_case__		)		):
												_SCREAMING_SNAKE_CASE     				=  order[len(snake_case__		) - i - 1]
												if not visited[vert]:
																		_SCREAMING_SNAKE_CASE     				=  find_components(snake_case__	,snake_case__	,snake_case__		)
																		components_list.append(snake_case__		)

						return components_list

