The well known PC game engineer Kevin Flynn designed a new game:Water World I.Player can enters the Virtual World and build the world through this game.
Jack is the Administrator of Virtual World.He is responsible for water conservation project.Now Kevin gives him an important mission:building a reservoir made with thousands of mountain.
The design chart of reservoir is very simple.every mountain's width is 1 unit and the hight is Hi numbered from left to right.The valley between two mountains can hold water.
After the project had been finished,the Virtual World War I broken out.The reservoir is affected by the war,it become tilt.Jack want to know how much water can it hold now.