407216: GYM102697 187 Mountain Biking
Description
You just went on a very hilly bike ride, and you want to find largest hill that you biked up during your ride.
You know the elevations of several points along your ride, and you want to find the vertical rise of the largest continously uphill section of the ride. A continuously uphill section must have a positive overall vertical rise, and must consist of only uphill segments. If a section of the ride has any downhill or flat subsections, it is not considered a continuously uphill section.
InputThe first line of input contains a single positive integer $$$n$$$: the number of points along the ride that you know the elevations for.
The next line contains $$$n$$$ space-separated integers: the elevation, along each point of the ride.
OutputOutput a single positive integer $$$v$$$: the value of the biggest hill on the ride, defined as the vertical rise of the largest continiously uphill section, as defined above. There is guaranteed to be at least one continously uphill section in the route given in the input.
ExamplesInput7 600 650 700 690 740 520 600Output
100Input
5 400 500 600 700 400Output
300Input
8 100 200 300 300 400 500 600 700Output
400