




'''simple docstring'''




UpperCAmelCase_				 =					[
    [0, 1_6, 1_3, 0, 0, 0],
    [0, 0, 1_0, 1_2, 0, 0],
    [0, 4, 0, 0, 1_4, 0],
    [0, 0, 9, 0, 0, 2_0],
    [0, 0, 0, 7, 0, 4],
    [0, 0, 0, 0, 0, 0],
]

def       _UpperCamelCase					( SCREAMING_SNAKE_CASE__	:					str				,  SCREAMING_SNAKE_CASE__	:					Optional[int]				,  SCREAMING_SNAKE_CASE__	:					int				,  SCREAMING_SNAKE_CASE__	:					Optional[Any]				):
 '''simple docstring'''





 UpperCAmelCase__								=			[False] * len(SCREAMING_SNAKE_CASE__				)
 UpperCAmelCase__								=			[s]
 UpperCAmelCase__								=			True

 while queue:
  UpperCAmelCase__								=			queue.pop(0				)
  for ind in range(len(graph[u]				)				):
   if visited[ind] is False and graph[u][ind] > 0:
    queue.append(SCREAMING_SNAKE_CASE__				)
    UpperCAmelCase__								=			True
    UpperCAmelCase__								=			u

 return visited[t]

def       _UpperCamelCase					( SCREAMING_SNAKE_CASE__	:					str				,  SCREAMING_SNAKE_CASE__	:					Dict				,  SCREAMING_SNAKE_CASE__	:					Tuple				):
 '''simple docstring'''





 UpperCAmelCase__								=			[-1] * (len(SCREAMING_SNAKE_CASE__				))
 UpperCAmelCase__								=			0
 UpperCAmelCase__								=			[]
 UpperCAmelCase__								=			[i[:] for i in graph]  # Record original cut, copy.
 while bfs(SCREAMING_SNAKE_CASE__				,  SCREAMING_SNAKE_CASE__				,  SCREAMING_SNAKE_CASE__				,  SCREAMING_SNAKE_CASE__				):
  UpperCAmelCase__								=			float("""Inf"""				)
  UpperCAmelCase__								=			sink

  while s != source:
   # Find the minimum value in select path
   UpperCAmelCase__								=			min(SCREAMING_SNAKE_CASE__				,  graph[parent[s]][s]				)
   UpperCAmelCase__								=			parent[s]

  max_flow += path_flow
  UpperCAmelCase__								=			sink

  while v != source:
   UpperCAmelCase__								=			parent[v]
   graph[u][v] -= path_flow
   graph[v][u] += path_flow
   UpperCAmelCase__								=			parent[v]

 for i in range(len(SCREAMING_SNAKE_CASE__				)				):
  for j in range(len(graph[0]				)				):
   if graph[i][j] == 0 and temp[i][j] > 0:
    res.append((i, j)				)

 return res


if __name__ == "__main__":
    print(mincut(test_graph, source=0, sink=5))







from __future__ import annotations







def  _SCREAMING_SNAKE_CASE				(   a					,						a					,						a  )      ->      float:
					if days_between_payments <= 0:
										raise ValueError('days_between_payments must be > 0'  )
					if daily_interest_rate < 0:
										raise ValueError('daily_interest_rate must be >= 0'  )
					if principal <= 0:
										raise ValueError('principal must be > 0'  )
					return principal * daily_interest_rate * days_between_payments







def  _SCREAMING_SNAKE_CASE				(   a					,						a					,						a					,						)      ->      float:
					if number_of_compounding_periods <= 0:
										raise ValueError('number_of_compounding_periods must be > 0'  )
					if nominal_annual_interest_rate_percentage < 0:
										raise ValueError('nominal_annual_interest_rate_percentage must be >= 0'  )
					if principal <= 0:
										raise ValueError('principal must be > 0'  )

					return principal * (
					    (1 + nominal_annual_interest_rate_percentage) ** number_of_compounding_periods
					    - 1
					)







def  _SCREAMING_SNAKE_CASE				(   a					,						a					,						a					,						)      ->      float:
					if number_of_years <= 0:
										raise ValueError('number_of_years must be > 0'  )
					if nominal_annual_percentage_rate < 0:
										raise ValueError('nominal_annual_percentage_rate must be >= 0'  )
					if principal <= 0:
										raise ValueError('principal must be > 0'  )

					return compound_interest(
					    a					,						nominal_annual_percentage_rate / 3_65					,						number_of_years * 3_65  )


if __name__ == "__main__":
				import doctest

				doctest.testmod()




