"""simple docstring"""






from __future__ import annotations

__lowerCAmelCase					: Optional[int]        =[]


def     UpperCAmelCase__ (       lowerCAmelCase__  :list[list[int]]      ,	lowerCAmelCase__  :int      ,	lowerCAmelCase__  :int	)				->					bool:
      '''simple docstring'''


      for i in range(len(lowerCAmelCase__	)	):
            if board[row][i] == 1:
                  return False
      for i in range(len(lowerCAmelCase__	)	):
            if board[i][column] == 1:
                  return False
      for i, j in zip(range(lowerCAmelCase__      ,	-1      ,	-1	)      ,	range(lowerCAmelCase__      ,	-1      ,	-1	)	):
            if board[i][j] == 1:
                  return False
      for i, j in zip(range(lowerCAmelCase__      ,	-1      ,	-1	)      ,	range(lowerCAmelCase__      ,	len(lowerCAmelCase__	)	)	):
            if board[i][j] == 1:
                  return False
      return True


def     UpperCAmelCase__ (       lowerCAmelCase__  :list[list[int]]      ,	lowerCAmelCase__  :int	)				->					bool:
      '''simple docstring'''


      if row >= len(lowerCAmelCase__	):
            solution.append(lowerCAmelCase__	)
            printboard(lowerCAmelCase__	)
            print()
            return True
      for i in range(len(lowerCAmelCase__	)	):
            if is_safe(lowerCAmelCase__      ,	lowerCAmelCase__      ,	lowerCAmelCase__	):
                  lowercase														=			1
                  solve(lowerCAmelCase__      ,	row + 1	)
                  lowercase														=			0
      return False


def     UpperCAmelCase__ (       lowerCAmelCase__  :list[list[int]]	)				->					None:
      '''simple docstring'''


      for i in range(len(lowerCAmelCase__	)	):
            for j in range(len(lowerCAmelCase__	)	):
                  if board[i][j] == 1:
                        print("""Q"""      ,	end=""" """	)
                  else:
                        print("""."""      ,	end=""" """	)
            print()


# n=int(input("The no. of queens"))
__lowerCAmelCase					: Tuple        =8
__lowerCAmelCase					: int        =[[0 for i in range(n)] for j in range(n)]
solve(board, 0)






print("""The total no. of solutions are :""", len(solution))




"""simple docstring"""






def     UpperCAmelCase__ (       lowerCAmelCase__  :int	)				->					bool:
      '''simple docstring'''


      lowercase														=			(1 + 2_4 * n) ** 0.5
      return ((1 + root) / 6) % 1 == 0


def     UpperCAmelCase__ (       lowerCAmelCase__  :int = 5_0_0_0	)				->					int:
      '''simple docstring'''


      lowercase														=			[(i * (3 * i - 1)) // 2 for i in range(1      ,	lowerCAmelCase__	)]
      for i, pentagonal_i in enumerate(lowerCAmelCase__	):
            for j in range(lowerCAmelCase__      ,	len(lowerCAmelCase__	)	):
                  lowercase														=			pentagonal_nums[j]
                  lowercase														=			pentagonal_i + pentagonal_j
                  lowercase														=			pentagonal_j - pentagonal_i
                  if is_pentagonal(lowerCAmelCase__	) and is_pentagonal(lowerCAmelCase__	):
                        return b

      return -1


if __name__ == "__main__":
       print(F"""{solution() = }""")



