"""simple docstring"""




def 							SCREAMING_SNAKE_CASE  (    _lowerCamelCase		: int    ,_lowerCamelCase		: int    ,_lowerCamelCase		: list[list[int]]			) ->   int:

  def update_area_of_max_square(_lowerCamelCase		: int    ,_lowerCamelCase		: int			) -> int:
    # BASE CASE
    if row >= rows or col >= cols:
      return 0

    _lowerCAmelCase		: List[str]						    =  update_area_of_max_square(_lowerCamelCase    ,col + 1			)
    _lowerCAmelCase		: Optional[int]						    =  update_area_of_max_square(row + 1    ,col + 1			)
    _lowerCAmelCase		: Optional[int]						    =  update_area_of_max_square(row + 1    ,_lowerCamelCase			)

    if mat[row][col]:
      _lowerCAmelCase		: Dict						    =  1 + min([right, diagonal, down]			)
      _lowerCAmelCase		: Optional[int]						    =  max(largest_square_area[0]    ,_lowerCamelCase			)
      return sub_problem_sol
    else:
      return 0

  _lowerCAmelCase		: int						    =  [0]
  update_area_of_max_square(0    ,0			)
  return largest_square_area[0]





def 							SCREAMING_SNAKE_CASE  (    _lowerCamelCase		: int    ,_lowerCamelCase		: int    ,_lowerCamelCase		: list[list[int]]			) ->   int:

  def update_area_of_max_square_using_dp_array(
      _lowerCamelCase		: int    ,_lowerCamelCase		: int    ,_lowerCamelCase		: list[list[int]]			) -> int:
    if row >= rows or col >= cols:
      return 0
    if dp_array[row][col] != -1:
      return dp_array[row][col]

    _lowerCAmelCase		: str						    =  update_area_of_max_square_using_dp_array(_lowerCamelCase    ,col + 1    ,_lowerCamelCase			)
    _lowerCAmelCase		: List[Any]						    =  update_area_of_max_square_using_dp_array(row + 1    ,col + 1    ,_lowerCamelCase			)
    _lowerCAmelCase		: str						    =  update_area_of_max_square_using_dp_array(row + 1    ,_lowerCamelCase    ,_lowerCamelCase			)

    if mat[row][col]:
      _lowerCAmelCase		: Any						    =  1 + min([right, diagonal, down]			)
      _lowerCAmelCase		: Any						    =  max(largest_square_area[0]    ,_lowerCamelCase			)
      _lowerCAmelCase		: str						    =  sub_problem_sol
      return sub_problem_sol
    else:
      return 0

  _lowerCAmelCase		: Union[str, Any]						    =  [0]
  _lowerCAmelCase		: Tuple						    =  [[-1] * cols for _ in range(_lowerCamelCase			)]
  update_area_of_max_square_using_dp_array(0    ,0    ,_lowerCamelCase			)

  return largest_square_area[0]





def 							SCREAMING_SNAKE_CASE  (    _lowerCamelCase		: int    ,_lowerCamelCase		: int    ,_lowerCamelCase		: list[list[int]]			) ->   int:
  _lowerCAmelCase		: int						    =  [[0] * (cols + 1) for _ in range(rows + 1			)]
  _lowerCAmelCase		: str						    =  0
  for row in range(rows - 1    ,-1    ,-1			):
    for col in range(cols - 1    ,-1    ,-1			):
      _lowerCAmelCase		: Tuple						    =  dp_array[row][col + 1]
      _lowerCAmelCase		: Optional[Any]						    =  dp_array[row + 1][col + 1]
      _lowerCAmelCase		: Dict						    =  dp_array[row + 1][col]

      if mat[row][col] == 1:
        _lowerCAmelCase		: Dict						    =  1 + min(_lowerCamelCase    ,_lowerCamelCase    ,_lowerCamelCase			)
        _lowerCAmelCase		: int						    =  max(dp_array[row][col]    ,_lowerCamelCase			)
      else:
        _lowerCAmelCase		: int						    =  0

  return largest_square_area





def 							SCREAMING_SNAKE_CASE  (    _lowerCamelCase		: int    ,_lowerCamelCase		: int    ,_lowerCamelCase		: list[list[int]]			) ->   int:
  _lowerCAmelCase		: int						    =  [0] * (cols + 1)
  _lowerCAmelCase		: Optional[Any]						    =  [0] * (cols + 1)
  _lowerCAmelCase		: List[Any]						    =  0
  for row in range(rows - 1    ,-1    ,-1			):
    for col in range(cols - 1    ,-1    ,-1			):
      _lowerCAmelCase		: List[str]						    =  current_row[col + 1]
      _lowerCAmelCase		: Dict						    =  next_row[col + 1]
      _lowerCAmelCase		: List[str]						    =  next_row[col]

      if mat[row][col] == 1:
        _lowerCAmelCase		: Any						    =  1 + min(_lowerCamelCase    ,_lowerCamelCase    ,_lowerCamelCase			)
        _lowerCAmelCase		: Optional[int]						    =  max(current_row[col]    ,_lowerCamelCase			)
      else:
        _lowerCAmelCase		: List[Any]						    =  0
    _lowerCAmelCase		: List[str]						    =  current_row

  return largest_square_area


if __name__ == "__main__":
     import doctest

     doctest.testmod()
     print(largest_square_area_in_matrix_bottom_up(2, 2, [[1, 1], [1, 1]]))





"""simple docstring"""




def 							SCREAMING_SNAKE_CASE  (    _lowerCamelCase		: int			) ->   bool:
  return sum(i for i in range(1    ,number // 2 + 1			) if number % i == 0			) == number


if __name__ == "__main__":
     print('Program to check whether a number is a Perfect number or not...')
     _a   :	int 					=     int(input('Enter number: ').strip())
     print(F"""{number} is {"" if perfect(number) else "not "}a Perfect Number.""")




