

lowercase     :       List[str]        =       [
    [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  UpperCAmelCase_   (_lowerCAmelCase :		int     ,			_lowerCAmelCase :		int     ,			_lowerCAmelCase :		int     ,			_lowerCAmelCase :		int		):
			return 0 <= row < rows and 0 <= col < cols







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







def  UpperCAmelCase_   (_lowerCAmelCase :		list[list[int]]		):
			__UpperCamelCase    :    set								=      set()

			__UpperCamelCase    :    Optional[Any]								=      0
			for row, line in enumerate(_lowerCAmelCase		):
						for col, item in enumerate(_lowerCAmelCase		):
									if item == 1 and (row, col) not in seen:
												# Maximizing the area
												__UpperCamelCase    :    Union[str, Any]								=      max(_lowerCAmelCase     ,			depth_first_search(_lowerCAmelCase     ,			_lowerCAmelCase     ,			_lowerCAmelCase     ,			_lowerCAmelCase		)		)
			return max_area


if __name__ == "__main__":
					import doctest

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


lowercase     :       dict[str, float]        =       {
    "kilogram": 1,
    "gram": pow(10, 3),
    "milligram": pow(10, 6),
    "metric-ton": pow(10, -3),
    "long-ton": 0.0009842073,
    "short-ton": 0.0011023122,
    "pound": 2.2046244202,
    "stone": 0.1574731728,
    "ounce": 35.273990723,
    "carrat": 5000,
    "atomic-mass-unit": 6.0_22_13_66_52E26,
}

lowercase     :       dict[str, float]        =       {
    "kilogram": 1,
    "gram": pow(10, -3),
    "milligram": pow(10, -6),
    "metric-ton": pow(10, 3),
    "long-ton": 1016.04608,
    "short-ton": 907.184,
    "pound": 0.453592,
    "stone": 6.35029,
    "ounce": 0.0283495,
    "carrat": 0.0002,
    "atomic-mass-unit": 1.6_60_54_01_99E-27,
}







def  UpperCAmelCase_   (_lowerCAmelCase :		str     ,			_lowerCAmelCase :		str     ,			_lowerCAmelCase :		float		):
			if to_type not in KILOGRAM_CHART or from_type not in WEIGHT_TYPE_CHART:
						__UpperCamelCase    :    Dict								=      (
						    F'''Invalid \'from_type\' or \'to_type\' value: {from_type!r}, {to_type!r}\n'''
						    F'''Supported values are: {", ".join(_lowerCAmelCase		)}'''
						)
						raise ValueError(_lowerCAmelCase		)
			return value * KILOGRAM_CHART[to_type] * WEIGHT_TYPE_CHART[from_type]


if __name__ == "__main__":
					import doctest

					doctest.testmod()