




def 		lowerCAmelCase_ (						lowerCamelCase						,  lowerCamelCase ):
				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_ (						lowerCamelCase						,  lowerCamelCase ):
				__magic_name__						:						Tuple										=[[float("""inf""" ) for _ in range(lowerCamelCase )] for _ in range(lowerCamelCase )]

				for i in range(lowerCamelCase ):
								for j in range(lowerCamelCase ):
												__magic_name__						:						Dict										=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]
																):
																				__magic_name__						:						List[str]										=dist[i][k] + dist[k][j]

				_print_dist(lowerCamelCase						,  lowerCamelCase )
				return dist, v


if __name__ == "__main__":
							UpperCAmelCase_		:					Optional[Any]          =  int(input("Enter number of vertices: "))
							UpperCAmelCase_		:					str          =  int(input("Enter number of edges: "))

							UpperCAmelCase_		:					Optional[Any]          =  [[float("inf") for i in range(v)] for j in range(v)]

							for i in range(v):
														UpperCAmelCase_		:					str          =  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)
														UpperCAmelCase_		:					Optional[Any]          =  int(input("Enter source:"))
														UpperCAmelCase_		:					Union[str, Any]          =  int(input("Enter destination:"))
														UpperCAmelCase_		:					Dict          =  float(input("Enter weight:"))
														UpperCAmelCase_		:					Union[str, Any]          =  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










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




def 		lowerCAmelCase_ (						lowerCamelCase ):

				# A local function to see if a dot lands in the circle.
				def is_in_circle(lowerCamelCase						,  lowerCamelCase ) -> bool:
								__magic_name__						:						Dict										=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
				__magic_name__						:						Union[str, Any]										=mean(
				    int(is_in_circle(uniform(-1.0						,  1.0 )						,  uniform(-1.0						,  1.0 ) ) )
				    for _ in range(lowerCamelCase ) )
				# The ratio of the area for circle to square is pi/4.
				__magic_name__						:						List[Any]										=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_ (						lowerCamelCase						,  lowerCamelCase						,  lowerCamelCase = 0.0						,  lowerCamelCase = 1.0						,  ):
				return mean(
				    function_to_integrate(uniform(lowerCamelCase						,  lowerCamelCase ) ) for _ in range(lowerCamelCase ) ) * (max_value - min_value)




def 		lowerCAmelCase_ (						lowerCamelCase						,  lowerCamelCase = 0.0						,  lowerCamelCase = 1.0 ):

				def identity_function(lowerCamelCase ) -> float:
								return x

				__magic_name__						:						Optional[int]										=area_under_curve_estimator(
				    lowerCamelCase						,  lowerCamelCase						,  lowerCamelCase						,  lowerCamelCase )
				__magic_name__						:						str										=(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_ (						lowerCamelCase ):

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

				__magic_name__						:						Dict										=area_under_curve_estimator(
				    lowerCamelCase						,  lowerCamelCase						,  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()




