





_lowerCamelCase       =	[
    [0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0],
    [0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0],
    [0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0],
    [0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0],
]






def  SCREAMING_SNAKE_CASE__							(				UpperCamelCase__:							int    ,      UpperCamelCase__:							int    ,      UpperCamelCase__:							int    ,      UpperCamelCase__:							int			):
		return 0 <= row < rows and 0 <= col < cols






def  SCREAMING_SNAKE_CASE__							(				UpperCamelCase__:							int    ,      UpperCamelCase__:							int    ,      UpperCamelCase__:							set    ,      UpperCamelCase__:							list[list[int]]			):
		SCREAMING_SNAKE_CASE__								=					len(UpperCamelCase__			)
		SCREAMING_SNAKE_CASE__								=					len(mat[0]			)
		if is_safe(UpperCamelCase__    ,      UpperCamelCase__    ,      UpperCamelCase__    ,      UpperCamelCase__			) and (row, col) not in seen and mat[row][col] == 1:
				seen.add((row, col)			)
				return (
				    1
				    + depth_first_search(row + 1    ,      UpperCamelCase__    ,      UpperCamelCase__    ,      UpperCamelCase__			)
				    + depth_first_search(row - 1    ,      UpperCamelCase__    ,      UpperCamelCase__    ,      UpperCamelCase__			)
				    + depth_first_search(UpperCamelCase__    ,      col + 1    ,      UpperCamelCase__    ,      UpperCamelCase__			)
				    + depth_first_search(UpperCamelCase__    ,      col - 1    ,      UpperCamelCase__    ,      UpperCamelCase__			)
				)
		else:
				return 0






def  SCREAMING_SNAKE_CASE__							(				UpperCamelCase__:							list[list[int]]			):
		SCREAMING_SNAKE_CASE__								=					set()

		SCREAMING_SNAKE_CASE__								=					0
		for row, line in enumerate(UpperCamelCase__			):
				for col, item in enumerate(UpperCamelCase__			):
						if item == 1 and (row, col) not in seen:
								# Maximizing the area
								SCREAMING_SNAKE_CASE__								=					max(UpperCamelCase__    ,      depth_first_search(UpperCamelCase__    ,      UpperCamelCase__    ,      UpperCamelCase__    ,      UpperCamelCase__			)			)
		return max_area


if __name__ == "__main__":
	import doctest

	print(find_max_area(matrix))  # Output -> 6
	doctest.testmod()






def    _lowercase    (  _UpperCAmelCase	,					_UpperCAmelCase )  ->     int:
				print("""\nVertex Distance""" )
				for i in range(_UpperCAmelCase ):
								if dist[i] != float("""inf""" ):
												print(_UpperCAmelCase	,					"""\t"""	,					int(dist[i] )	,					end="""\t""" )
								else:
												print(_UpperCAmelCase	,					"""\t"""	,					"""INF"""	,					end="""\t""" )
								print()





def    _lowercase    (  _UpperCAmelCase	,					_UpperCAmelCase	,					_UpperCAmelCase )  ->     Dict:
				lowerCamelCase		       =float("""inf""" )
				lowerCamelCase		       =-1
				for i in range(_UpperCAmelCase ):
								if (not vset[i]) and mdist[i] < min_val:
												lowerCamelCase		       =i
												lowerCamelCase		       =mdist[i]
				return min_ind





def    _lowercase    (  _UpperCAmelCase	,					_UpperCAmelCase	,					_UpperCAmelCase )  ->     Optional[int]:
				lowerCamelCase		       =[float("""inf""" ) for _ in range(_UpperCAmelCase )]
				lowerCamelCase		       =[False for _ in range(_UpperCAmelCase )]
				lowerCamelCase		       =0.0

				for _ in range(v - 1 ):
								lowerCamelCase		       =min_dist(_UpperCAmelCase	,					_UpperCAmelCase	,					_UpperCAmelCase )
								lowerCamelCase		       =True

								for i in range(_UpperCAmelCase ):
												if (
												    (not vset[i])
												    and graph[u][i] != float("""inf""" )
												    and mdist[u] + graph[u][i] < mdist[i]
												):
																lowerCamelCase		       =mdist[u] + graph[u][i]

				print_dist(_UpperCAmelCase	,					_UpperCAmelCase )


if __name__ == "__main__":
							UpperCAmelCase__  :	Tuple     =int(input('''Enter number of vertices: ''').strip())
							UpperCAmelCase__  :	str     =int(input('''Enter number of edges: ''').strip())

							UpperCAmelCase__  :	str     =[[float('''inf''') for i in range(V)] for j in range(V)]

							for i in range(V):
														UpperCAmelCase__  :	Dict     =0.0

							for i in range(E):
														print('''\nEdge ''', i + 1)
														UpperCAmelCase__  :	int     =int(input('''Enter source:''').strip())
														UpperCAmelCase__  :	str     =int(input('''Enter destination:''').strip())
														UpperCAmelCase__  :	List[Any]     =float(input('''Enter weight:''').strip())
														UpperCAmelCase__  :	str     =weight

							UpperCAmelCase__  :	Tuple     =int(input('''\nEnter shortest path source:''').strip())
							dijkstra(graph, V, gsrc)





