





import math
class 			UpperCamelCase_		:




					def __init__(		self				,						lowerCAmelCase_=0  )		->							Optional[int]:  # a graph with Node 0,1,...,N-1
										_snake_case									=				n
										_snake_case									=				[
										    [math.inf for j in range(0				,						lowerCAmelCase_  )] for i in range(0				,						lowerCAmelCase_  )
										]  # adjacency matrix for weight
										_snake_case									=				[
										    [math.inf for j in range(0				,						lowerCAmelCase_  )] for i in range(0				,						lowerCAmelCase_  )
										]  # dp[i][j] stores minimum distance from i to j




					def 	lowerCAmelCase			(		self				,						lowerCAmelCase_				,						lowerCAmelCase_				,						lowerCAmelCase_  )		->							Optional[int]:
										_snake_case									=				w




					def 	lowerCAmelCase			(		self  )		->							Tuple:
										for k in range(0				,						self.n  ):
															for i in range(0				,						self.n  ):
																				for j in range(0				,						self.n  ):
																									_snake_case									=				min(self.dp[i][j]				,						self.dp[i][k] + self.dp[k][j]  )






					def 	lowerCAmelCase			(		self				,						lowerCAmelCase_				,						lowerCAmelCase_  )		->							int:
										return self.dp[u][v]


if __name__ == "__main__":
					UpperCAmelCase_      							=     Graph(5)
					graph.add_edge(0, 2, 9)
					graph.add_edge(0, 4, 10)
					graph.add_edge(1, 3, 5)
					graph.add_edge(2, 3, 7)
					graph.add_edge(3, 0, 10)
					graph.add_edge(3, 1, 2)
					graph.add_edge(3, 2, 1)
					graph.add_edge(3, 4, 6)
					graph.add_edge(4, 1, 3)
					graph.add_edge(4, 2, 4)
					graph.add_edge(4, 3, 9)
					graph.floyd_warshall()
					graph.show_min(1, 4)
					graph.show_min(0, 3)










from cva import destroyAllWindows, imread, imshow, waitKey





def 						lowerCamelCase__     (     UpperCamelCase__			:       Optional[int]						)			-> Optional[int]:



					'''simple docstring'''




					_snake_case							,     _snake_case									=				img.shape[0], img.shape[1]

					# converting each pixel's color to its negative
					for i in range(UpperCamelCase__						):
										for j in range(UpperCamelCase__						):
															_snake_case									=				[255, 255, 255] - img[i][j]

					return img


if __name__ == "__main__":
					# read original image
					UpperCAmelCase_      							=     imread("""image_data/lena.jpg""", 1)

					# convert to its negative
					UpperCAmelCase_      							=     convert_to_negative(img)

					# show result image
					imshow("""negative of original image""", img)
					waitKey(0)
					destroyAllWindows()



