




import math





def      UpperCAmelCase  (						UpperCamelCase__   )     ->     list:







				'''simple docstring'''


				if n <= 0:
								raise ValueError("""Only positive integers have prime factors"""   )
				__lowerCAmelCase					=  []
				while n % 2 == 0:
								pf.append(2   )
								__lowerCAmelCase					=  int(n / 2   )
				for i in range(3						,			int(math.sqrt(lowerCamelCase__   )   ) + 1						,			2   ):
								while n % i == 0:
												pf.append(lowerCamelCase__   )
												__lowerCAmelCase					=  int(n / i   )
				if n > 2:
								pf.append(lowerCamelCase__   )
				return pf





def      UpperCAmelCase  (						UpperCamelCase__   )     ->     int:







				'''simple docstring'''


				if n <= 0:
								raise ValueError("""Only positive numbers are accepted"""   )
				__lowerCAmelCase					=  1
				__lowerCAmelCase					=  1
				while n % 2 == 0:
								temp += 1
								__lowerCAmelCase					=  int(n / 2   )
				div *= temp
				for i in range(3						,			int(math.sqrt(lowerCamelCase__   )   ) + 1						,			2   ):
								__lowerCAmelCase					=  1
								while n % i == 0:
												temp += 1
												__lowerCAmelCase					=  int(n / i   )
								div *= temp
				if n > 1:
								div *= 2
				return div





def      UpperCAmelCase  (						UpperCamelCase__   )     ->     int:







				'''simple docstring'''


				if n <= 0:
								raise ValueError("""Only positive numbers are accepted"""   )
				__lowerCAmelCase					=  1
				__lowerCAmelCase					=  1
				while n % 2 == 0:
								temp += 1
								__lowerCAmelCase					=  int(n / 2   )
				if temp > 1:
								s *= (2**temp - 1) / (2 - 1)
				for i in range(3						,			int(math.sqrt(lowerCamelCase__   )   ) + 1						,			2   ):
								__lowerCAmelCase					=  1
								while n % i == 0:
												temp += 1
												__lowerCAmelCase					=  int(n / i   )
								if temp > 1:
												s *= (i**temp - 1) / (i - 1)
				return int(lowerCamelCase__   )





def      UpperCAmelCase  (						UpperCamelCase__   )     ->     int:







				'''simple docstring'''


				__lowerCAmelCase					=  n
				for x in set(prime_factors(lowerCamelCase__   )   ):
								s *= (x - 1) / x
				return int(lowerCamelCase__   )


if __name__ == "__main__":
	import doctest

	doctest.testmod()













UpperCamelCase											=      [
    [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       _a   (							lowerCamelCase__ ,			lowerCamelCase__ ,			lowerCamelCase__ ,			lowerCamelCase__				)  ->      bool:
 return 0 <= row < rows and 0 <= col < cols




def       _a   (							lowerCamelCase__ ,			lowerCamelCase__ ,			lowerCamelCase__ ,			lowerCamelCase__				)  ->      int:
 lowerCamelCase_							:    Tuple							=     len(lowerCamelCase__				)
 lowerCamelCase_							:    Tuple							=     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       _a   (							lowerCamelCase__				)  ->      int:
 lowerCamelCase_							:    set							=     set()

 lowerCamelCase_							:    int							=     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
    lowerCamelCase_							:    str							=     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()
