# loop until user doesn't enter valid radius of the circle
while True:
    # take input from user as radius
    radius_of_circle = input("Please enter radius of circle:\n")
    if radius_of_circle.isdigit():
        radius_of_circle = float(radius_of_circle)
        break
    else:
        print("That seems to be invalid radius, please try again:")

# loop until user doesn't enter valid side of the square
while True:
    # take input from user as side
    side_of_square = float(input("Please enter side of square:\n"))
    if side_of_square > radius_of_circle*2:
        print("That seems a little big, please try again:")
    else:
        break

# loop until user doesn't enter valid width of the rectangle
while True:
    # take input from user as width
    width_of_rectangle = float(input("Please enter width of rectangle:\n"))
    if width_of_rectangle > radius_of_circle*2:
        print("That seems a little big, please try again:")
    else:
        break

# loop until user doesn't enter valid length of the rectangle
while True:
    # take input from user as length
    length_of_rectangle = float(input("Please enter length of rectangle:\n"))
    if length_of_rectangle > radius_of_circle*2:
        print("That seems a little big, please try again:")
    else:
        break

total_area_of_circle = 3.14 * \
    (radius_of_circle ** 2)  # calculated total area of circle
total_area_of_square = side_of_square ** 2  # calculated total area of square
total_area_of_rectangle = width_of_rectangle * \
    length_of_rectangle  # calculated total area of rectangle

# calculated blue shaded area of the circle
shaded_area = total_area_of_circle - \
    total_area_of_square - total_area_of_rectangle

# print the result
print(f"The shaded area is {shaded_area} cm")
