import math


def option_two_flowerbed_area():

    def getVars():
        # asks for user input
        sidelength = float(input("Side length? (feet) "))
        flowerdistance = float(input("Flower distance? (feet) "))
        beddepth = float(input("Flowerbed depth? (feet) "))
        filldepth = float(input("Fill depth? (feet) "))

        if ((sidelength or flowerdistance or beddepth or filldepth) <= 0):
            # makes sure I have actual numbers to prevent weird stuff from happening
            print("One or more invalid input(s), please resubmit values")
            getVars()

        else:
            # all the math happens here, this only runs if I have valid input values
            circleArea = (math.pi * ((sidelength / 4) ** 2))
            semicircleArea = (circleArea / 2)
            totalBedArea = (circleArea+(semicircleArea * 4))

            circlePlants = int(circleArea / (flowerdistance ** 2))
            semicirclePlants = int(semicircleArea / (flowerdistance ** 2))
            totalPlants = (circlePlants + (semicirclePlants * 4))

            totalFillArea = ((sidelength ** 2) - totalBedArea)

            circleVolume = (circleArea * beddepth)
            semicircleVolume = (semicircleArea * beddepth)
            totalBedVolume = (totalBedArea * beddepth)

            totalFillVolume = (totalFillArea * filldepth)

            def transformVars(var):
                # converts cubic feet into cubic yards and rounds to one decimal
                return str((int((var / 27) * 10) / 10))

            # gives the user all the data they need
            print("Plants in circle: " + str(circlePlants))
            print("Plants in one semicircle: " + str(semicirclePlants))
            print("Plants in all semicircles: " + str((semicirclePlants * 4)))
            print("Total plants: " + str(totalPlants))

            print("Soil in circle: " + transformVars(circleVolume) + " cubic yards")
            print("Soil in one semicircle: " + transformVars(semicircleVolume) + " cubic yards")
            print("Soil in all semicircles: " + transformVars(semicircleVolume * 4) + " cubic yards")
            print("Total soil: " + transformVars(totalBedVolume) + " cubic yards")

            print("Total fill: " + transformVars(totalFillVolume) + " cubic yards")

    # this makes it run
    getVars()


option_two_flowerbed_area()