




def       SCREAMING_SNAKE_CASE			( __UpperCamelCase    :		int ,  __UpperCamelCase    :		int = 1000   )						->							str:
				if (not isinstance(__UpperCamelCase ,  __UpperCamelCase   )) or (digit_position <= 0):
								raise ValueError('''Digit position must be a positive integer'''   )
				elif (not isinstance(__UpperCamelCase ,  __UpperCamelCase   )) or (precision < 0):
								raise ValueError('''Precision must be a nonnegative integer'''   )

				# compute an approximation of (16 ** (n - 1)) * pi whose fractional part is mostly
				# accurate
				UpperCAmelCase_											=  (
				    4 * _subsum(__UpperCamelCase ,  1 ,  __UpperCamelCase   )
				    - 2 * _subsum(__UpperCamelCase ,  4 ,  __UpperCamelCase   )
				    - _subsum(__UpperCamelCase ,  5 ,  __UpperCamelCase   )
				    - _subsum(__UpperCamelCase ,  6 ,  __UpperCamelCase   )
				)

				# return the first hex digit of the fractional part of the result
				return hex(int((sum_result % 1) * 16   )   )[2:]




def       SCREAMING_SNAKE_CASE			( __UpperCamelCase    :		int ,  __UpperCamelCase    :		int ,  __UpperCamelCase    :		int   )						->							float:
				UpperCAmelCase_											=  0.0
				for sum_index in range(digit_pos_to_extract + precision   ):
								UpperCAmelCase_											=  8 * sum_index + denominator_addend
								if sum_index < digit_pos_to_extract:
												# if the exponential term is an integer and we mod it by the denominator
												# before dividing, only the integer part of the sum will change;
												# the fractional part will not
												UpperCAmelCase_											=  pow(
												    16 ,  digit_pos_to_extract - 1 - sum_index ,  __UpperCamelCase   )
								else:
												UpperCAmelCase_											=  pow(16 ,  digit_pos_to_extract - 1 - sum_index   )
								total += exponential_term / denominator
				return total


if __name__ == "__main__":
	import doctest

	doctest.testmod()











_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   )						->							bool:
    return 0 <= row < rows and 0 <= col < cols




def       SCREAMING_SNAKE_CASE			( __UpperCamelCase    :		int ,  __UpperCamelCase    :		int ,  __UpperCamelCase    :		set ,  __UpperCamelCase    :		list[list[int]]   )						->							int:
    UpperCAmelCase_											=  len(__UpperCamelCase   )
    UpperCAmelCase_											=  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]]   )						->							int:
    UpperCAmelCase_											=  set()

    UpperCAmelCase_											=  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
                UpperCAmelCase_											=  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()





