The purpose is to write a function to calculate the cheapest possible cost of building a wall based on the number of bricks required for the wall and the distance between the brick store and the site of the future wall. Your method of moving bricks from the store to the site of the future wall are by generic carriers that you have hired, arranged in a firemans line. Each carrier accepts a brick from one side (either another carrier or the store) and delivers it to the other side (either the next carrier or the final site)

Givens:

You have an unlimited pool of brick carriers.

Brick carriers cost $5/hr

Bricks cost $20

Brick Carrier Movement:

Brick carriers take 20 seconds to turn 180 degrees whether or not they are carrying a brick

Distance covered by a carrier turning 180 degrees is .5 meters

Brick carriers walk at .5 meters/second when carrying a brick

Brick carriers walk at .75 meters/second when unburdened (conserving their strength)

Assumptions:

You will only have one line of brick carriers, no parellel distribution lines

The function or query you write will accept the target number of bricks and distance (in meters) between the store and the brick pile/wall. The best solution is the one that is the cheapest. Return the cheapest cost, number of carriers, and amount of time.

I believe I covered all the variables from my notes, but if something obvious is missing please let me know. For the sake of comparison, lets see the results for:

50 bricks at 10 meters

50 bricks at 20 meters

100 bricks at 100 meters

1000 bricks at 100 meters