






'''simple docstring'''




class    _UpperCAmelCase			:




   """simple docstring"""

   def __init__(		self :	List[str]      ,      __UpperCAmelCase :	list[int]		):





         '''simple docstring'''





         _A			     =	len(__UpperCAmelCase		)
         _A			     =	[0] * len_array

         if len_array > 0:
               _A			     =	array[0]

         for i in range(1      ,      __UpperCAmelCase		):
               _A			     =	self.prefix_sum[i - 1] + array[i]

   def 						lowerCAmelCase (		self :	Dict      ,      __UpperCAmelCase :	int      ,      __UpperCAmelCase :	int		):





         '''simple docstring'''





         if start == 0:
               return self.prefix_sum[end]

         return self.prefix_sum[end] - self.prefix_sum[start - 1]

   def 						lowerCAmelCase (		self :	List[str]      ,      __UpperCAmelCase :	int		):





         '''simple docstring'''





         _A			     =	{0}
         for sum_item in self.prefix_sum:
               if sum_item - target_sum in sums:
                     return True

               sums.add(__UpperCAmelCase		)

         return False


if __name__ == "__main__":
    import doctest

    doctest.testmod()













import math

class 						lowerCAmelCase   :

					'''simple docstring'''

					def __init__(     self :		Tuple						,   __a :		int=0							)	->     Optional[Any]:  # a graph with Node 0,1,...,N-1


												"""simple docstring"""

												__lowercase					:							Any			=   n
												__lowercase					:							Optional[int]			=   [
												    [math.inf for j in range(0						,   __a							)] for i in range(0						,   __a							)
												]  # adjacency matrix for weight
												__lowercase					:							Dict			=   [
												    [math.inf for j in range(0						,   __a							)] for i in range(0						,   __a							)
												]  # dp[i][j] stores minimum distance from i to j



					def 					lowerCAmelCase (     self :		int						,   __a :		Optional[int]						,   __a :		Tuple						,   __a :		Dict							)	->     Dict:


												"""simple docstring"""

												__lowercase					:							Any			=   w



					def 					lowerCAmelCase (     self :		List[str]							)	->     Tuple:


												"""simple docstring"""

												for k in range(0						,   self.n							):
																			for i in range(0						,   self.n							):
																										for j in range(0						,   self.n							):
																																	__lowercase					:							List[str]			=   min(self.dp[i][j]						,   self.dp[i][k] + self.dp[k][j]							)



					def 					lowerCAmelCase (     self :		Any						,   __a :		Any						,   __a :		str							)	->     int:


												"""simple docstring"""

												return self.dp[u][v]


if __name__ == "__main__":
	lowerCamelCase       :       int        =				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)