"""simple docstring"""
def    lowerCAmelCase__    (			_UpperCamelCase       :				List[str] ,			_UpperCamelCase       :				int					)					->				Union[str, Any]:





						"""simple docstring"""






						print('\nThe shortest path matrix using Floyd Warshall algorithm\n'					)
						for i in range(lowerCamelCase__					):
												for j in range(lowerCamelCase__					):
																		if dist[i][j] != float('inf'					):
																								print(int(dist[i][j]					) ,			end='\t'					)
																		else:
																								print('INF' ,			end='\t'					)
												print()





def    lowerCAmelCase__    (			_UpperCamelCase       :				List[str] ,			_UpperCamelCase       :				int					)					->				List[Any]:





						"""simple docstring"""






						snake_case								=			[[float('inf'					) for _ in range(lowerCamelCase__					)] for _ in range(lowerCamelCase__					)]

						for i in range(lowerCamelCase__					):
												for j in range(lowerCamelCase__					):
																		snake_case								=			graph[i][j]

																		# check vertex k against all other vertices (i, j)
						for k in range(lowerCamelCase__					):
												# looping through rows of graph array
												for i in range(lowerCamelCase__					):
																		# looping through columns of graph array
																		for j in range(lowerCamelCase__					):
																								if (
																								    dist[i][k] != float('inf'					)
																								    and dist[k][j] != float('inf'					)
																								    and dist[i][k] + dist[k][j] < dist[i][j]
																								):
																														snake_case								=			dist[i][k] + dist[k][j]

						_print_dist(lowerCamelCase__ ,			lowerCamelCase__					)
						return dist, v


if __name__ == "__main__":
					SCREAMING_SNAKE_CASE__      						=  int(input("Enter number of vertices: "))
					SCREAMING_SNAKE_CASE__      						=  int(input("Enter number of edges: "))

					SCREAMING_SNAKE_CASE__      						=  [[float("inf") for i in range(v)] for j in range(v)]

					for i in range(v):
										SCREAMING_SNAKE_CASE__      						=  0.0

										# src and dst are indices that must be within the array size graph[e][v]
										# failure to follow this will result in an error
					for i in range(e):
										print("\nEdge ", i + 1)
										SCREAMING_SNAKE_CASE__      						=  int(input("Enter source:"))
										SCREAMING_SNAKE_CASE__      						=  int(input("Enter destination:"))
										SCREAMING_SNAKE_CASE__      						=  float(input("Enter weight:"))
										SCREAMING_SNAKE_CASE__      						=  weight

					floyd_warshall(graph, v)

					# Example Input
					# Enter number of vertices: 3
					# Enter number of edges: 2

					# # generated graph from vertex and edge inputs
					# [[inf, inf, inf], [inf, inf, inf], [inf, inf, inf]]
					# [[0.0, inf, inf], [inf, 0.0, inf], [inf, inf, 0.0]]

					# specify source, destination and weight for edge #1
					# Edge  1
					# Enter source:1
					# Enter destination:2
					# Enter weight:2

					# specify source, destination and weight for edge #2
					# Edge  2
					# Enter source:2
					# Enter destination:1
					# Enter weight:1

					# # Expected Output from the vertice, edge and src, dst, weight inputs!!
					# 0		INF	INF
					# INF	0	2
					# INF	1	0



"""simple docstring"""
from collections.abc import Callable
from math import pi, sqrt
from random import uniform
from statistics import mean





def    lowerCAmelCase__    (			_UpperCamelCase       :				int					)					->				Dict:





						"""simple docstring"""






						def is_in_circle(_UpperCamelCase       :				float ,			_UpperCamelCase       :				float					) -> bool:
												snake_case								=			sqrt((x**2) + (y**2)					)
												# Our circle has a radius of 1, so a distance
												# greater than 1 would land outside the circle.
												return distance_from_centre <= 1

						# The proportion of guesses that landed in the circle
						snake_case								=			mean(
						    int(is_in_circle(uniform(-1.0 ,			1.0					) ,			uniform(-1.0 ,			1.0					)					)					)
						    for _ in range(_UpperCamelCase					)					)
						# The ratio of the area for circle to square is pi/4.
						snake_case								=			proportion * 4
						print(f"""The estimated value of pi is {pi_estimate}"""					)
						print(f"""The numpy value of pi is {pi}"""					)
						print(f"""The total error is {abs(pi - pi_estimate					)}"""					)





def    lowerCAmelCase__    (			_UpperCamelCase       :				int ,			_UpperCamelCase       :				Callable[[float], float] ,			_UpperCamelCase       :				float = 0.0 ,			_UpperCamelCase       :				float = 1.0 ,			)					->				float:





						"""simple docstring"""






						return mean(
						    function_to_integrate(uniform(_UpperCamelCase ,			_UpperCamelCase					)					) for _ in range(_UpperCamelCase					)					) * (max_value - min_value)





def    lowerCAmelCase__    (			_UpperCamelCase       :				int ,			_UpperCamelCase       :				float = 0.0 ,			_UpperCamelCase       :				float = 1.0					)					->				None:





						"""simple docstring"""






						def identity_function(_UpperCamelCase       :				float					) -> float:
												return x

						snake_case								=			area_under_curve_estimator(
						    _UpperCamelCase ,			_UpperCamelCase ,			_UpperCamelCase ,			_UpperCamelCase					)
						snake_case								=			(max_value * max_value - min_value * min_value) / 2

						print('******************'					)
						print(f"""Estimating area under y=x where x varies from {min_value} to {max_value}"""					)
						print(f"""Estimated value is {estimated_value}"""					)
						print(f"""Expected value is {expected_value}"""					)
						print(f"""Total error is {abs(estimated_value - expected_value					)}"""					)
						print('******************'					)





def    lowerCAmelCase__    (			_UpperCamelCase       :				int					)					->				None:





						"""simple docstring"""






						def function_to_integrate(_UpperCamelCase       :				float					) -> float:
												return sqrt(4.0 - x * x					)

						snake_case								=			area_under_curve_estimator(
						    _UpperCamelCase ,			_UpperCamelCase ,			0.0 ,			2.0					)

						print('******************'					)
						print('Estimating pi using area_under_curve_estimator'					)
						print(f"""Estimated value is {estimated_value}"""					)
						print(f"""Expected value is {pi}"""					)
						print(f"""Total error is {abs(estimated_value - pi					)}"""					)
						print('******************'					)


if __name__ == "__main__":
					import doctest

					doctest.testmod()


