



from __future__ import annotations

from collections.abc import Callable







def   __snake_case			(    _UpperCAmelCase     ,				_UpperCAmelCase     ,				_UpperCAmelCase     ,				_UpperCAmelCase = 100     ,				):
    __a		 =       x_start
    __a		 =       fnc(_UpperCAmelCase       )
    __a		 =       0.0
    for _ in range(_UpperCAmelCase       ):
        # Approximates small segments of curve as linear and solve
        # for trapezoidal area
        __a		 =       (x_end - x_start) / steps + xa
        __a		 =       fnc(_UpperCAmelCase       )
        area += abs(fxa + fxa       ) * (xa - xa) / 2
        # Increment step
        __a		 =       xa
        __a		 =       fxa
    return area


if __name__ == "__main__":







 def   __snake_case			(    _UpperCAmelCase       ):
     return x**3 + x**2

 print('''f(x) = x^3 + x^2''')
 print('''The area between the curve, x = -5, x = 5 and the x axis is:''')
 __snake_case		:Optional[Any]   	=  10
 while i <= 10_0000:
  print(f'with {i} steps: {trapezoidal_area(f, -5, 5, i)}')
  i *= 10










from __future__ import annotations

__snake_case		:Optional[Any]   	=  []





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





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





def   __snake_case			(    _UpperCAmelCase       ):
    for i in range(len(_UpperCAmelCase       )       ):
        for j in range(len(_UpperCAmelCase       )       ):
            if board[i][j] == 1:
                print('''Q'''     ,				end=''' '''       )
            else:
                print('''.'''     ,				end=''' '''       )
        print()


# n=int(input("The no. of queens"))
__snake_case		:Optional[Any]   	=  8
__snake_case		:Tuple   	=  [[0 for i in range(n)] for j in range(n)]
solve(board, 0)
print('''The total no. of solutions are :''', len(solution))





