The well known PC game engineer Kevin Flynn designed a new game:Water World II.Player can enters the Virtual Water 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 a big mission:building a reservoir made with thousands of mountain.
Every mountain's width is 1 unit and the hight is Hi .Mountain numbered from left to right.The valley between two mountains can hold water.
Jack can move the leftmost mountain to the rightmost for several times(include zero).
In order to complete the project,Kevin provide k unit building materials for Jack .Jack can add them to some mountain’s top
(In order to maintain the stability of reservoir,The maximum height can not be changed).