Problem 4: Landscaping
Farmer John is making the difficult transition from raising mountain
goats to raising cows. His farm, while ideal for mountain goats,
is far too mountainous for cattle and thus needs to be flattened
out a bit. Since flattening is an expensive operation, he wants to
remove the smallest amount of earth possible.
The farm is long and narrow and is described in a sort of two-dimensional
profile by a single array of N (1

