Jack and Jill

Jack and Jill went up the hill to fetch a pail of water. Well, they probably need to fetch many pails of water in this problem. The problem is to determine how long it will take Jack and Jill to fetch a specified volume of water. Jack and Jill require UP seconds (always greater than one) to travel from the bottom of the hill to the top, where the well is located. The well is a circular cylinder with a diameter of D inches, and before any water is removed, the water level is L inches below its top. The single bucket, with a capacity of B cubic feet, when dropped into the well (with a rope attached, of course) accelerates at 32.2 feet per second per second (due to gravity). The bucket is pulled up at a rate of P inches per second. It requires DOWN seconds to carry the bucket to the bottom of the hill and empty it. Jack and Jill begin at the bottom of the hill. They both immediately go to the top of the hill, where Jill fetches water from the well: dropping the bucket (which we assume will immediately fill completely when it reaches the water), pulling it up, and passing it to Jack (instantaneously). Assume the water level in the well drops only after the bucket is lifted. Jack then carries the bucket down the hill, empties it (instantaneously), goes back up the hill, and gives the bucket to Jill (instantaneously). This process repeats until the required volume of water (V cubic feet) has been carried to the bottom of the hill. The problem, again, is to determine how long it takes Jack and Jill to accomplish their task. Input The input contains multiple scenarios, each having values for U P, D, L, B, P, DOW N , and V (all posi- tive non-zero real numbers) in that order on a separate line. A line containing a single value less than one appears following the data for the last scenario. Output For each scenario, display the scenario number (they start with 1 and are numbered sequentially), the input values, and the time required, in seconds (accurate to two fractional digits). The samples shown below illustrate an acceptable output format. Print a blank line between test cases. By the way, you can assume the well never runs dry, even though its volume only diminishes during Jack and Jill’s activities! Sample Input 20.0 36.0 72.0 2.0 10.0 18.0 10.0 25.0 72.0 200.0 1.5 8.0 30.0 20.0 0.0 Sample Output Scenario 1: up hill well diameter water level bucket volume bucket ascent rate down hill 20.00 sec 36.00 in 72.00 in 2.00 cu ft 10.00 in/sec 18.00 sec

2/2 required volume TIME REQUIRED Scenario 2: up hill well diameter water level bucket volume bucket ascent rate down hill required volume TIME REQUIRED 10.00 cu ft 232.59 sec 25.00 sec 72.00 in 200.00 in 1.50 cu ft 8.00 in/sec 30.00 sec 20.00 cu ft 1141.63 sec