There is a horse which can jump over trees and he has to jump N trees sequentially.
Initially, the horse has zero energy.
Jumping trees, he loses energy (one unit of energy per unit of height) and he gets points as the amount of left energy (Left energy can be less than 0).
And his final score is the sum of all points that the horse gets after each jump.
The horse can do two types of tricks.
*Just before every jump, he can eat a tree. Of course, he jumps over the eaten tree which has no height.
*Just after every jump, he can have a break. After each break, he restores energy. It means that his energy becomes the total sum of heights of all eaten trees.
But he has limits, he can have at most K breaks and eat at most M trees.
You have to find the maximum score that the horse can gets.