The creek bed is dry. We are given the elevation of the creek bed every 50
feet horizontally along its course, west to east. Our town is located in a valley
just to the east of the last elevation. It has just started raining at a
rate of r inches per hour over the entire creek bed. (This means that in a volume
with straight sides and a flat bottom the water level would rise r inches per hour.)
We can treat this as a 2-dimensional problem by approximating the creek as
having a constant width. We will assume that the creek bed is made up of linear segments between
the known elevations. We will also treat the water as flowing instantaneously.
Given r, and a int[] ht giving the elevations (in feet) in order from west to
east, return the number of hours before the water starts flooding the town.
|