


"""simple docstring"""

def lowerCAmelCase_      (				UpperCamelCase__	: str ):






 """simple docstring"""







 __lowercase									=	[0 for i in range(len(UpperCamelCase__ ) )]

 # initialize interval's left pointer and right pointer
 __lowercase							,		__lowercase									=	0, 0

 for i in range(1				,   len(UpperCamelCase__ ) ):
  # case when current index is inside the interval
  if i <= right_pointer:
   __lowercase									=	min(right_pointer - i + 1				,   z_result[i - left_pointer] )
   __lowercase									=	min_edge

  while go_next(UpperCamelCase__				,   UpperCamelCase__				,   UpperCamelCase__ ):
   z_result[i] += 1

  # if new index's result gives us more right interval,
  # we've to update left_pointer and right_pointer
  if i + z_result[i] - 1 > right_pointer:
   __lowercase							,		__lowercase									=	i, i + z_result[i] - 1

 return z_result


def lowerCAmelCase_      (				UpperCamelCase__	: int				,   UpperCamelCase__	: list[int]				,   UpperCamelCase__	: str ):






 """simple docstring"""







 return i + z_result[i] < len(UpperCamelCase__ ) and s[z_result[i]] == s[i + z_result[i]]


def lowerCAmelCase_      (				UpperCamelCase__	: str				,   UpperCamelCase__	: str ):






 """simple docstring"""







 __lowercase									=	0
 # concatenate 'pattern' and 'input_str' and call z_function
 # with concatenated string
 __lowercase									=	z_function(pattern + input_str )

 for val in z_result:
  # if value is greater then length of the pattern string
  # that means this index is starting position of substring
  # which is equal to pattern string
  if val >= len(UpperCamelCase__ ):
   answer += 1

 return answer


if __name__ == "__main__":
       import doctest

       doctest.testmod()




"""simple docstring"""

def lowerCAmelCase_      (				UpperCamelCase__	: Optional[Any]				,   UpperCamelCase__	: int				,   UpperCamelCase__	: Optional[Any]				,   UpperCamelCase__	: str ):






 """simple docstring"""







 __lowercase									=	[False] * len(UpperCamelCase__ )
 __lowercase									=	[]
 queue.append(UpperCamelCase__ )
 __lowercase									=	True

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

 return visited[t]


def lowerCAmelCase_      (				UpperCamelCase__	: str				,   UpperCamelCase__	: Any				,   UpperCamelCase__	: Optional[int] ):






 """simple docstring"""







 __lowercase									=	[-1] * (len(UpperCamelCase__ ))
 __lowercase									=	0
 while bfs(UpperCamelCase__				,   UpperCamelCase__				,   UpperCamelCase__				,   UpperCamelCase__ ):
  __lowercase									=	float("""Inf""" )
  __lowercase									=	sink

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

  max_flow += path_flow
  __lowercase									=	sink

  while v != source:
   __lowercase									=	parent[v]
   graph[u][v] -= path_flow
   graph[v][u] += path_flow
   __lowercase									=	parent[v]
 return max_flow


UpperCAmelCase__  							=[
    [0, 16, 13, 0, 0, 0],
    [0, 0, 10, 12, 0, 0],
    [0, 4, 0, 0, 14, 0],
    [0, 0, 9, 0, 0, 20],
    [0, 0, 0, 7, 0, 4],
    [0, 0, 0, 0, 0, 0],
]

UpperCAmelCase__							,      UpperCAmelCase__  							=0, 5

print(ford_fulkerson(graph, source, sink))
